wsadmin com.ibm.ws.exception.RuntimeWarning: java.lang.NoClassDefFoundError: - maven-2

After installing ear file through wsadmin script getting below error when starting server.
i checked within the ear file the same class present in one of the jar.
com.ibm.ws.exception.RuntimeWarning: java.lang.NoClassDefFoundError:
Please suggest any solution for this issue.

There was a classpath issue. Actually i am using Maven for building the EAR. Maven has overwirte my classpath and i removed the same. Also removed maven generated maven folder inside META-INF folder of jar/ejb. addMavenDescriptor>false /addMavenDescriptor>
Thanks bkail.

Related

How do you change the class path to a jar file on intellij idea?

How do you change the classpath to a jar file or a different directory?
Go to File-> Project Structure-> Libraries and click green "+" to add the directory folder that has the JARs to CLASSPATH. Everything in that folder will be added to CLASSPATH. Update: It's 2018. It's a better idea to use a dependency manager like Maven and externalize your dependencies. Don't add JAR files to your project in a /lib folder anymore.
I am attempting to add an external jar to my module's build path. I've added the jar as a module dependency and as a library, and the compiler is still unable to find the jar. I'm using intelliJ 14.1. I have verified that the jar is intact and not corrupt.
JAR manifest: IntelliJ IDEA will pass a long classpath via a temporary classpath.jar. The original classpath is defined in the manifest file as a class-path attribute in classpath.jar . You will be able to preview the full command line if it was shortened using this method, not just the classpath of the temporary classpath.jar .

maven build - IntelliJ

I am trying to create a jar in IntelliJ through maven clean-compile-package. Build is sucessful but I am not getting class and packages in tha jar. Please help! I got below warning in logs:
[WARNING] JAR will be empty - no content was marked for inclusion!
maven project have default standard directory layout its documented here
if you not followed them or moved folders around, maybe changed output folder or similar action was taken, maven can't correctly decide how to include your class files.

IntelliJ Spring Boot: How to create an executable jar

I'm trying to create an executable jar from IntelliJ.
First I got the Java Security Exception and I changed sqljdbc4-4.0 to unsigned. First problem solved.
Then I got Manifest not found. Added META-INF dir to output. Second problem solved.
Next I got the BeanCreationException (unsolved):
Caused by: org.springframework.beans.factory.BeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath.
In IntelliJ it is working.
I think the resources are not in the output. (application.properties, ...)
In which way do I add the resources or where are they stored in the jar.
I'm using gradle and on the spring boot homepage are only instructions for maven.
You should use spring-boot-maven-plugin or spring-boot-gradle-plugin, depending on your preferred build system.
EDIT:
Just run ./gradlew build
I suggest to dive into this getting started guide. It clarifies a lot of stuff for beginners.
A typical Spring boot project is a Maven project or a Gradle-Project (I only know how to do it with Maven, for Gradle see [luboskrnacs answer][1]). So you just need to run the maven targetpackageand pick the jar form the (created)target` folder
use a shell, go to the project root directory (where the pom.xml file is) and type
mvn clean package
cd target
the there is the xxx.jar file.

jar discrepancy in war and ear

I have a ear which contains EJB's and war file and this ear is deployed in weblogic server
Now I have a jar which is a dependency for classes inside and outside war.
When I include this dependency in app/lib and web-inf/lib and deployed it in weblogic server I get an exception saying class not found. Now when I exclude the jar from App-INF removing the EJB which is dependent on this jar and deploy it . It works fine.
Is there any way I put dependency in APP-INF and WEB-INf and still this works fine.
You want your JAR to be present on APP-INF/lib level of the EAR.
This way, the WAR will automatically see the JAR as well. You should then not need your JAR within the WAR.
Otherwise, search for "Optional Package" here and with Oracle.
You can deploy your JAR and have the EAR and WAR refer to it.

How to avoid the dependencies of jar files to be included in the war build

I have customized pom.xml in maven to build a war file, for which i am compiling few class files which in deed depends on some jar files. Which i have included them as dependencies.
The build was successful but end result puts me in trouble now i have those class files included in my war which i don't want it.
So can you please help me to get rid of jar getting included in lib folder of war.
Regards
Gnash-85
You just have to change the "scope" of your dependencies in the Maven pom from "compile" (by default) to "provided". The "provided" libs won't be included in the final war file.
All options are listed on the Maven documentation.