I recently faced an issue when deploying an Spring 3.0 based Web-Application in Eclipse Helios IDE. I have included the spring & its dependency jar files in BuildPath -> Libraries -> Add External Jars from my local repository(maven local repo). When I'm trying to start the server, it throws ClassNotFoundException,
NOTE: I can find my Spring-web jar in Eclipse Buildpath-Libraries.
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at `enter code here`org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
.classpath file:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="rest-client/src/main/java"/>
<classpathentry kind="src" path="rtsocketdatamonitor/src/main/java"/>
<classpathentry kind="src" path="rtsocketdatamonitor/src/main/resources"/>
<classpathentry kind="src" path="rest-client/src/main/resources"/>
<classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.2/commons-lang-2.2.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.2/commons-lang-2.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.2/slf4j-api-1.6.2.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-commons-annotations/3.2.0.Final/hibernate-commons-annotations-3.2.0.Final.jar" sourcepath="M2_REPO/org/hibernate/hibernate-commons-annotations/3.2.0.Final/hibernate-commons-annotations-3.2.0.Final-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final.jar" sourcepath="M2_REPO/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar" sourcepath="M2_REPO/javax/transaction/jta/1.1/jta-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-entitymanager/3.6.0.Final/hibernate-entitymanager-3.6.0.Final.jar" sourcepath="M2_REPO/org/hibernate/hibernate-entitymanager/3.6.0.Final/hibernate-entitymanager-3.6.0.Final-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/cglib/cglib/2.2/cglib-2.2.jar" sourcepath="M2_REPO/cglib/cglib/2.2/cglib-2.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javassist/javassist/3.12.0.GA/javassist-3.12.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.12.0.GA/javassist-3.12.0.GA-sources.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.5.6/slf4j-log4j12-1.5.6.jar" sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.5.6/slf4j-log4j12-1.5.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-asm/3.0.5.RELEASE/spring-asm-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-asm/3.0.5.RELEASE/spring-asm-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-beans/3.0.5.RELEASE/spring-beans-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-beans/3.0.5.RELEASE/spring-beans-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-aspects/3.0.5.RELEASE/spring-aspects-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-aspects/3.0.5.RELEASE/spring-aspects-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-expression/3.0.5.RELEASE/spring-expression-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-expression/3.0.5.RELEASE/spring-expression-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-context-support/3.0.5.RELEASE/spring-context-support-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-context-support/3.0.5.RELEASE/spring-context-support-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-test/3.0.5.RELEASE/spring-test-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-test/3.0.5.RELEASE/spring-test-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-jdbc/3.0.5.RELEASE/spring-jdbc-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-jdbc/3.0.5.RELEASE/spring-jdbc-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-tx/3.0.5.RELEASE/spring-tx-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-tx/3.0.5.RELEASE/spring-tx-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-orm/3.0.5.RELEASE/spring-orm-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-orm/3.0.5.RELEASE/spring-orm-3.0.5.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE.jar" sourcepath="/SPRING_SOURCE_3.0.1/org.springframework.web-sources-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar"/>
<classpathentry kind="lib" path="D:/ProgramJR/spring/servlet-api-2.5.jar" sourcepath="C:/Users/sasikumar.s/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
But, When i added the jars in WEB-INF/lib folder, the application runs properly.( Could not find above errors)
Kindly clarify about the difference between "Adding jars in Build Path" and WEB-INF/lib folder. I'm not interested in adding jars to every project.
Appreciate your help.
Related
I am running the below code in a gradle project in Eclipse.
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
I am getting ClassNotFoundException for this. The class runs fine in a maven project. Maven's .classpath file looks like this.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"
including="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
</classpath>
This is Gradle's .classpath file
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main"
path="src/main/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope"
value="main,test,intTest"/>
</attributes>
</classpathentry>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/
org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/
JavaSE-11/"/>
<classpathentry kind="con"
path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
Is there anything I need to add to build.gradle or make changes to .classpath file to make it work?
I have cloned hibernate tools and I can build it from maven, however after running mvn eclipse:eclipse I get a .classpath that looks like
<classpathentry kind="lib" path="h2/target/hibernate-tools-tests-h2-6.0.0-SNAPSHOT-sources.jar"/>
<classpathentry kind="lib" path="h2/target/hibernate-tools-tests-h2-6.0.0-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="maven/target/hibernate-tools-tests-maven-6.0.0-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="maven/target/local-repo/antlr/antlr/2.7.7/antlr-2.7.7.jar"/>
<classpathentry kind="lib" path="maven/target/local-repo/com/fasterxml/classmate/1.3.4/classmate-1.3.4.jar"/>
<classpathentry kind="lib" path="maven/target/local-repo/com/h2database/h2/1.4.195/h2-1.4.195.jar"/>
<classpathentry kind="lib" path="maven/target/local-repo/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar"/>
<classpathentry kind="lib" path="maven/target/local-repo/commons-logging/commons-logging/1.2/commons-logging-1.2.jar"/>
These jars are in my ~/.m2/repository but the specified location does
not in fact have the jars
./hibernate-tools/test/maven/target/local-repo/dom4j/dom4j/1.6.1
dom4j-1.6.1.pom
dom4j-1.6.1.pom.sha1
_remote.repositories
How can I use eclipse on this projecgt?
Eclipse is giving me a red X on a project. I compared this project to a similar one in another workspace. The classpath is different (it's supposed to be), and a few source files that are supposed to be. But the error in the problems tab says
"The project was not built due to "". Fix the problem, then try refreshing this project and building it since it may be inconsistent"
Yeah, that key spot where it seems like critical information would go just says "". I tried refreshing and rebuilding to no avail. The project is imported from outside the workspace. But that shouldn't matter, should it? I've done that before with no problems. But a similar project (the one I am comparing to) works fine in the workspace.
Where else can I look for error info that might help me narrow this down?
update - This project is used by others as a project reference, but this project does not rely on others. Here is it's classpath file contents:
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.ibm.ws.ast.st.runtime.runtimeTarget.v70/was.base.v7">
<attributes>
<attribute name="owner.project.facets" value="jst.utility"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/WebSphere Application Server v7.0 JRE">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/antlr-2.7.6.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/aspectjweaver-1.6.8.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/cecore.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/celib.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/ceplugins_client.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/ceplugins_core.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/ceplugins_cr.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/cereports.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/cesession.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/ceutils.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/cglib-nodep-2.2.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/aopalliance-1.0.0.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/apache-commons/commons-beanutils.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/apache-commons/commons-collections-3.2.1.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/apache-commons/commons-lang-2.4.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/apache-commons/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/corbaidl.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/ebus405.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/hibernate/hibernate-3.5.1/hibernate3.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/icu4j-3.4.4.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/jasypt-1.7.1.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/javassist-3.9.0.GA.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/joda-time-1.6.1.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/jpa-api-2.0-cr-1.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/junit-4.8.2.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/log4j-1.2.5.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/buisnessObjects/logging.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.aop-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.asm-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.aspects-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.beans-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.context.support-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.context-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.core-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.expression-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.instrument.tomcat-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.instrument-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.jdbc-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.jms-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.orm-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.oxm-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.test-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.transaction-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.web.portlet-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.web.servlet-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.web.struts-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/spring/spring-framework-3.0.1/org.springframework.web-3.0.1.RELEASE-A.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/poi-3.7-beta3-20100924.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/serialization.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/SL_plugins.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/slf4j-api-1.5.8.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/misc3rdParty/slf4j-log4j12-1.5.8.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-1.4.7.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-auth-roles-1.4.7.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-datetime-1.4.7.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-devutils-1.4.7.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-extensions-1.4.7.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-guice-1.4.7.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-ioc-1.4.7.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-jmx-1.4.7.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-objectsizeof-agent-1.4.7.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-spring-1.4.7.jar"/>
<classpathentry kind="lib" path="C:/views/SharedComp_Development/SharedComp_Software/jar/wicket/wicket-1.4.7/wicket-velocity-1.4.7.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Sounds like the project has a dependency defined but the project name was removed. This can be done with the .classpath file is manually edited. I would try to remove all the dependent projects from the .classpath file.
You can do this from Eclipse by editing the build path and removing any projects. Then add the dependent proejcts back. This should clean up the .classpath file.
Thanks to Zagrev for helping, but it turns out, someone had checked our bin folder into our integrated source control and so eclipse wasn't actually able to compile the code. Once I deleted the bin and it could generate, it generated fine and the error went away.
Still, FANTASTICALLY unhelpful message there eclipse. Had the message directed me towards unwritable class files, I'd probably have found it right away. Instead I floundered for hours trying to figure out what was wrong with my .classpath or .settings.
The sources are downloaded in the Gradle cache and the classpath-entries for the source files looks ok, but Eclipse does not show the source files for 3rd party libs.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="output" path="bin/main"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry output="bin/test" kind="src" path="src/test/java"/>
<classpathentry output="bin/test" kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container" exported="true"/>
<classpathentry sourcepath="D:/Users/SSchneider/.gradle/caches/artifacts-14/filestore/org.springframework/spring-webmvc/3.1.2.RELEASE/source/bc9c347358c5d59998b27e8a13c75106c3d0696/spring-webmvc-3.1.2.RELEASE-sources.jar" kind="lib" path="D:/Users/SSchneider/.gradle/caches/artifacts-14/filestore/org.springframework/spring-webmvc/3.1.2.RELEASE/jar/e02f3e5aa91c8caa37b2e9b780229d27e76c0f2e/spring-webmvc-3.1.2.RELEASE.jar" exported="true">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry sourcepath="D:/Users/SSchneider/.gradle/caches/artifacts-14/filestore/org.springframework.data/spring-data-jpa/1.2.0.BUILD-SNAPSHOT/source/19e4dedbb956cdc3bb1d34d61a351229b653029a/spring-data-jpa-1.2.0.BUILD-SNAPSHOT-sources.jar" kind="lib" path="D:/Users/SSchneider/.gradle/caches/artifacts-14/filestore/org.springframework.data/spring-data-jpa/1.2.0.BUILD-SNAPSHOT/jar/2a3cfc2ea0b2c8d87f32166e16bb56e1f092568b/spring-data-jpa-1.2.0.BUILD-SNAPSHOT.jar" exported="true">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry sourcepath="D:/Users/SSchneider/.gradle/caches/artifacts-14/filestore/org.springframework.security/spring-security-web/3.1.2.RELEASE/source/49e8d929d835d4ba4556ba9d138488ecc083a794/spring-security-web-3.1.2.RELEASE-sources.jar" kind="lib" path="D:/Users/SSchneider/.gradle/caches/artifacts-14/filestore/org.springframework.security/spring-security-web/3.1.2.RELEASE/jar/e43e7683289f08c1e073564a94e6f26298ec4f59/spring-security-web-3.1.2.RELEASE.jar" exported="true">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry sourcepath="D:/Users/SSchneider/.gradle/caches/artifacts-14/filestore/javax.validation/validation-api/1.0.0.GA/source/7a561191db2203550fbfa40d534d4997624cd369/validation-api-1.0.0.GA-sources.jar" kind="lib" path="D:/Users/SSchneider/.gradle/caches/artifacts-14/filestore/javax.validation/validation-api/1.0.0.GA/jar/b6bd7f9d78f6fdaa3c37dae18a4bd298915f328e/validation-api-1.0.0.GA.jar" exported="true">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
</classpath>
That's a weird behavior in Eclipse with the generated .classpath-file. Just put the 'Web App Libraries' entry at the bottom of your classpath file (-> Java Build Path -> Order and Export).
The best solution is to enhance your gradle.build file (then you don't need to reorder your build path each time you generate the classpath file via gradle):
...
eclipse.classpath.file {
// Classpath entry for Eclipse which changes the order of classpathentries; otherwise no sources for 3rd party jars are shown
withXml { xml ->
def node = xml.asNode()
node.remove( node.find { it.#path == 'org.eclipse.jst.j2ee.internal.web.container' } )
node.appendNode( 'classpathentry', [ kind: 'con', path: 'org.eclipse.jst.j2ee.internal.web.container', exported: 'true'])
}
}
I have a multiple maven project like this:
root/
----war
----jar1
----jar2
----jar3
The war use jar1, jar2 and jar3
When I run a "mvn clean install", the compiled war is good and work fine in my server (jboss).
When I run a "mvn eclipse:eclipse" to generate my eclipse configuration, the build works but when I import my projects in eclipse (Indigo) and I publish my war in my server, jar1, jar2, jar3 are not publish.
In the war build path configuration, jar1, jar2, jar3 are well configured.
But when I look at the deployment assembly for the war project, I have the next error:
Here is my generated .classpath file for the war project:
<classpath>
<classpathentry kind="src" path="src/main/java" including="**/*.java"/>
<classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="var" path="M2_REPO/javax/faces/jsf-api/1.2_13/jsf-api-1.2_13.jar" sourcepath="M2_REPO/javax/faces/jsf-api/1.2_13/jsf-api-1.2_13-sources.jar">
<attributes>
<attribute value="jar:file:/Users/Kiva/java/repoMaven/javax/faces/jsf-api/1.2_13/jsf-api-1.2_13-javadoc.jar!/" name="javadoc_location"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/javax/faces/jsf-impl/1.2_13/jsf-impl-1.2_13.jar" sourcepath="M2_REPO/javax/faces/jsf-impl/1.2_13/jsf-impl-1.2_13-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar" sourcepath="M2_REPO/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2.jar" sourcepath="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar" sourcepath="M2_REPO/javax/el/el-api/1.0/el-api-1.0-sources.jar">
<attributes>
<attribute value="/WEB-INF/lib" name="org.eclipse.jst.component.dependency"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="/jar1"/>
<classpathentry kind="src" path="/jar2"/>
<classpathentry kind="src" path="/jar3"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE-sources.jar">
<attributes>
<attribute value="/WEB-INF/lib" name="org.eclipse.jst.component.dependency"/>
</attributes>
</classpathentry>
</classpath>
Here is my eclipse plugin configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
I don't understand why it's wrong in my plugin configuration and why eclipse doesn't find jars.
Thanks for your help.
The most important thing in that case is: Don't use eclipse:eclipse anymore use the m2e plugin instead in relationship with Maven. Just simply do an import of the project. You should add m2e for wtp via Eclipse Marketplace. After that you should be able to deploy the war to the server.
You could give a try to Eclipse Multi-project Import/Export. I think it will cover your needs.
I have found the problem.
The jboss tools maven support plugin (install with jboss tools) break the link between projects. Uninstalling it will solve the problem.
It's possible to uninstall just the maven support and keep the rest ;)