Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.9.4, 0.9.5, 0.9.6
-
Fix Version/s: 0.9.9
-
Component/s: WTP integration
-
Labels:None
-
Environment:Windows XP, eclipse Version: 3.3.1.1, Maven 2.0.9
-
Testcase included:yes
-
Number of attachments :12
Description
After the migration of m2eclipse from 0.0.12 to 0.9.4 we have the problem, that dependencies with scope provided are packaged into the ear!
So we can't deploy because this new behaviour results in classloader problems.
The dependency section in our parent pom looks like this:
<dependencies> <dependency> <groupId>javax.j2ee</groupId> <artifactId>j2ee</artifactId> <version>1.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.9</version> <scope>provided</scope> </dependency> </dependencies>
Both artifacts are packaged into the ear.
-
Hide
- ear_produced_by_maven_pure.ear
- 05/Sep/08 8:06 AM
- 19 kB
- Ulli Adrion
-
- META-INF/MANIFEST.MF 0.2 kB
- META-INF/application.xml 0.6 kB
- sample-ejb-0.0.1-SNAPSHOT.jar 7 kB
- sample-ejb-client-0.0.1-SNAPSHOT.jar 3 kB
- sample-ejb-client-view-0.0.1-SNAPSHOT.jar 7 kB
- sample-web-0.0.1-SNAPSHOT.war 6 kB
- META-INF/maven/.../sample-ear/pom.xml 2 kB
- META-INF/maven/.../sample-ear/pom.properties 0.1 kB
-
Hide
- ear_produced_by_wtp_m2plugin.ear
- 05/Sep/08 8:06 AM
- 3.30 MB
- Ulli Adrion
-
- META-INF/MANIFEST.MF 0.1 kB
- META-INF/application.xml 0.7 kB
- j2ee-1.4.jar 1.66 MB
- log4j-1.2.9.jar 344 kB
- sample-ejb-client-view.jar 8 kB
- sample-ejb-client.jar 4 kB
- sample-ejb.jar 13 kB
- sample-web.war 1.68 MB
-
Hide
- example-ejb-ear.zip
- 29/Sep/08 4:11 AM
- 12 kB
- Ulli Adrion
-
- another-EJB/.classpath 0.8 kB
- another-EJB/.project 1 kB
- another-EJB/.../org.eclipse.jdt.core.prefs 0.6 kB
- another-EJB/.../org.eclipse.jst.common.project.facet.core.prefs 0.4 kB
- another-EJB/.../org.eclipse.wst.common.component 0.3 kB
- another-EJB/.../org.eclipse.wst.common.project.facet.core.xml 0.3 kB
- another-EJB/.../org.maven.ide.eclipse.prefs 0.2 kB
- another-EJB/build/.../test/Test.class 0.4 kB
- another-EJB/build/.../test/TestRemote.class 0.2 kB
- another-EJB/build/.../META-INF/ejb-jar.xml 0.4 kB
- another-EJB/build/.../META-INF/MANIFEST.MF 0.0 kB
- another-EJB/ejbModule/com/.../test/Test.java 0.3 kB
- another-EJB/ejbModule/.../TestRemote.java 0.1 kB
- another-EJB/ejbModule/.../ejb-jar.xml 0.4 kB
- another-EJB/ejbModule/.../MANIFEST.MF 0.0 kB
- another-EJB/pom.xml 1 kB
- another-EJB/target/.../test/Test.class 0.4 kB
- another-EJB/target/.../test/TestRemote.class 0.2 kB
- another-EJB/target/.../META-INF/ejb-jar.xml 0.4 kB
- another-EJB/target/.../META-INF/MANIFEST.MF 0.0 kB
- another-ear/.project 0.7 kB
- another-ear/.../org.eclipse.wst.common.component 0.8 kB
- another-ear/.../org.eclipse.wst.common.project.facet.core.xml 0.2 kB
- another-ear/EarContent/.../application.xml 0.6 kB
-
Hide
- mngeclipse-714-example-project.zip
- 27/Jul/08 5:44 PM
- 7 kB
- Larry North
-
- mngeclipse-714/.classpath 0.8 kB
- mngeclipse-714/.project 1 kB
- mngeclipse-714/.settings/.jsdtscope 0.4 kB
- mngeclipse-714/.../org.eclipse.jdt.core.prefs 0.3 kB
- mngeclipse-714/.../org.eclipse.jst.common.project.facet.core.prefs 0.4 kB
- mngeclipse-714/.../org.eclipse.wst.common.component 0.4 kB
- mngeclipse-714/.../org.eclipse.wst.common.project.facet.core.xml 0.3 kB
- mngeclipse-714/.../org.eclipse.wst.jsdt.ui.superType.container 0.0 kB
- mngeclipse-714/.../org.eclipse.wst.jsdt.ui.superType.name 0.0 kB
- mngeclipse-714/.../org.maven.ide.eclipse.prefs 0.2 kB
- mngeclipse-714/pom.xml 0.7 kB
- mngeclipse-714/src/.../HelloWorld.java 0.7 kB
- mngeclipse-714/src/.../META-INF/MANIFEST.MF 0.0 kB
- mngeclipse-714/src/main/.../WEB-INF/web.xml 0.6 kB
-
Hide
- org.eclipse.wst.server.core.zip
- 17/Oct/08 11:27 AM
- 680 kB
- Alex Savitsky
-
- org.eclipse.wst.server.core/.../publish0.dat 0.3 kB
- org.eclipse.wst.server.core/publish.xml 0.2 kB
- org.eclipse.wst.server.core/servers.xml 0.6 kB
- org.eclipse.wst.server.core/tmp-data.xml 0.2 kB
- org.eclipse.wst.server.core/.../catalina.policy 9 kB
- org.eclipse.wst.server.core/.../catalina.properties 4 kB
- org.eclipse.wst.server.core/.../context.xml 1 kB
- org.eclipse.wst.server.core/.../server.xml 1 kB
- org.eclipse.wst.server.core/.../tomcat-users.xml 0.3 kB
- org.eclipse.wst.server.core/tmp0/.../web.xml 49 kB
- org.eclipse.wst.server.core/tmp0/.../web.xml 0.3 kB
- org.eclipse.wst.server.core/.../MANIFEST.MF 0.0 kB
- org.eclipse.wst.server.core/.../log4j.properties 0.0 kB
- org.eclipse.wst.server.core/.../activation-1.1.jar 62 kB
- org.eclipse.wst.server.core/.../junit-3.8.2.jar 118 kB
- org.eclipse.wst.server.core/.../mail-1.4.1.jar 437 kB
- org.eclipse.wst.server.core/.../servlet-api-2.4.jar 95 kB
- org.eclipse.wst.server.core/tmp0/.../web.xml 0.6 kB
-
Hide
- sample-eclipse-projects.zip
- 05/Sep/08 8:06 AM
- 143 kB
- Ulli Adrion
-
- sample-ejb-client-view/.classpath 0.7 kB
- sample-ejb-client-view/.project 1 kB
- sample-ejb-client-view/.../org.eclipse.jdt.core.prefs 0.3 kB
- sample-ejb-client-view/.../org.eclipse.jst.common.project.facet.core.prefs 0.3 kB
- sample-ejb-client-view/.../org.eclipse.wst.common.component 0.2 kB
- sample-ejb-client-view/.../org.eclipse.wst.common.project.facet.core.xml 0.3 kB
- sample-ejb-client-view/.../org.maven.ide.eclipse.prefs 0.2 kB
- sample-ejb-client-view/bin/.../Sample.class 0.2 kB
- sample-ejb-client-view/.../SampleBusiness.class 0.2 kB
- sample-ejb-client-view/.../SampleHome.class 0.4 kB
- sample-ejb-client-view/.../SampleUtil.class 4 kB
- sample-ejb-client-view/bin/.../Feeling.class 0.4 kB
- sample-ejb-client-view/.../FeelMeLocal.class 0.2 kB
- sample-ejb-client-view/.../FeelMeLocalBusiness.class 0.2 kB
- sample-ejb-client-view/.../FeelMeLocalHome.class 0.4 kB
- sample-ejb-client-view/bin/.../MANIFEST.MF 0.0 kB
- sample-ejb-client-view/.../Sample.java 0.2 kB
- sample-ejb-client-view/.../SampleBusiness.java 0.2 kB
- sample-ejb-client-view/.../SampleHome.java 0.5 kB
- sample-ejb-client-view/.../SampleUtil.java 4 kB
- sample-ejb-client-view/.../Feeling.java 0.2 kB
- sample-ejb-client-view/.../FeelMeLocal.java 0.3 kB
- sample-ejb-client-view/.../FeelMeLocalBusiness.java 0.2 kB
- sample-ejb-client-view/.../FeelMeLocalHome.java 0.4 kB
- sample-ejb-client-view/.../MANIFEST.MF 0.0 kB
- sample-ejb-client-view/pom.xml 0.5 kB
- sample-ejb-client-view/.../Sample.class 0.2 kB
- sample-ejb-client-view/.../SampleBusiness.class 0.2 kB
- sample-ejb-client-view/.../SampleHome.class 0.4 kB
- sample-ejb-client-view/.../SampleUtil.class 4 kB
-
Hide
- sample-ejb-ear-support.zip
- 29/Oct/08 3:51 AM
- 117 kB
- Ulli Adrion
-
- sample-web/.classpath 0.8 kB
- sample-web/.project 1 kB
- sample-web/.settings/.jsdtscope 0.5 kB
- sample-web/.../org.eclipse.jdt.core.prefs 0.6 kB
- sample-web/.../org.eclipse.jst.common.project.facet.core.prefs 0.4 kB
- sample-web/.../org.eclipse.wst.common.component 0.4 kB
- sample-web/.../org.eclipse.wst.common.project.facet.core.xml 0.3 kB
- sample-web/.../org.eclipse.wst.jsdt.ui.superType.container 0.0 kB
- sample-web/.../org.eclipse.wst.jsdt.ui.superType.name 0.0 kB
- sample-web/.../org.maven.ide.eclipse.prefs 0.2 kB
- sample-web/build/.../web/SampleServlet.class 2 kB
- sample-web/Click here to view SampleServlet.url 0.2 kB
- sample-web/pom.xml 1 kB
- sample-web/src/.../web/SampleServlet.java 2 kB
- sample-web/src/main/.../META-INF/MANIFEST.MF 0.0 kB
- sample-web/target/.../SampleServlet.class 3 kB
- sample-web/target/.../META-INF/MANIFEST.MF 0.0 kB
- sample-web/target/.../META-INF/MANIFEST.MF 0.0 kB
- sample-web/target/.../SampleServlet.class 2 kB
- sample-web/target/.../WEB-INF/jboss-web.xml 0.6 kB
- sample-web/.../sample-ejb-client-view-0.0.1-SNAPSHOT.jar 7 kB
- sample-web/target/.../WEB-INF/web.xml 4 kB
- sample-web/.../sample-web-0.0.1-SNAPSHOT-sources.jar 2 kB
- sample-web/.../sample-web-0.0.1-SNAPSHOT.war 6 kB
- sample-web/target/.../work/webapp-cache.xml 0.5 kB
- sample-web/WebContent/.../MANIFEST.MF 0.0 kB
- sample-web/WebContent/.../jboss-web.xml 0.6 kB
- sample-web/WebContent/WEB-INF/web.xml 4 kB
- sample-ejb/.classpath 0.8 kB
- sample-ejb/.project 1 kB
-
Hide
- test.zip
- 17/Oct/08 10:14 AM
- 5 kB
- Alex Savitsky
-
- test/.classpath 0.7 kB
- test/.project 1 kB
- test/.settings/.jsdtscope 0.4 kB
- test/.../org.eclipse.jdt.core.prefs 0.6 kB
- test/.../org.eclipse.jst.common.project.facet.core.prefs 0.4 kB
- test/.../org.eclipse.wst.common.component 0.4 kB
- test/.../org.eclipse.wst.common.project.facet.core.xml 0.3 kB
- test/.../org.eclipse.wst.jsdt.ui.superType.container 0.0 kB
- test/.../org.eclipse.wst.jsdt.ui.superType.name 0.0 kB
- test/.../org.maven.ide.eclipse.prefs 0.2 kB
- test/build/log4j.properties 0.0 kB
- test/pom.xml 2 kB
- test/src/log4j.properties 0.0 kB
- test/web/META-INF/MANIFEST.MF 0.0 kB
- test/web/WEB-INF/web.xml 0.6 kB
-
- j2ee_dependencies.png
- 137 kB
- 21/Jul/08 6:48 PM
-
- JEEdependencies.jpg
- 72 kB
- 29/Sep/08 4:11 AM
-
- maven_dependencies.png
- 187 kB
- 21/Jul/08 6:49 PM
-
- WTP-Server-deploy.jpg
- 109 kB
- 29/Sep/08 4:11 AM
Issue Links
- depends upon
-
MNGECLIPSE-688
support EAR and EJB projects
-
- relates to
-
MNGECLIPSE-688
support EAR and EJB projects
-
Activity
Ok – packaging is not the right word in this context. What I mean is that when we deploy it to our JBoss server via WTP mechanism the ear file contains the provided libraries.
Can you provide sample project(s) and instructions how to configure WTP and JBoss to reproduce the problem?
This happens with wars as well. It actually blocks tomcat from starting.
The issue is, there is only one library added to the project, it contains everything, regardless of scope. When deploying to the server "run as --> run on server" the provided and test dependencies should be left out.
I've added two images to demonstrate.
Paul, if you are able to reproduce this issue, can you please attach sample project that would allow us to reproduce. It would be a huge help. Thanks.
Although this is not possible to see in the GUI, not all entries from Maven Dependencies classpath container are supposed to be included in J2EE Module Dependencies. So these screenshots look absolutely normal and we really need sample project(s) to reproduce and troubleshoot the problem.
Here is a simple project that I believe demonstrates this problem with Tomcat 5.5. If the servlet-api-2.4 dependency is removed from the pom, the error does not occur. The selected Server Options are 1) Serve modules without publishing and 2) Publish module contexts to separate XML files. The console output shows:
Jul 27, 2008 5:31:58 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jdk1.5.0_15\bin;.; C:\Windows\system32;C:\Windows; C:\Windows\system32;C:\Windows; C:\Windows\System32\Wbem; C:\Program Files (x86)\CyberLink\Power2Go\; C:\Program Files (x86)\Apache Software Foundation\apache-maven-2.0.9\bin; C:\Program Files (x86)\Java\jdk1.5.0_15\bin; C:\Program Files (x86)\File Checksum Integrity Verifier Utility; C:\Program Files (x86)\GNU\GnuPG; C:\Sun\JEE5\SDK\bin; C:\Program Files (x86)\Apache Software Foundation\apache-ant-1.7.0\bin Jul 27, 2008 5:31:59 PM org.apache.coyote.http11.Http11BaseProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Jul 27, 2008 5:31:59 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1342 ms Jul 27, 2008 5:31:59 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Jul 27, 2008 5:31:59 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.26 Jul 27, 2008 5:31:59 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Jul 27, 2008 5:31:59 PM org.apache.coyote.http11.Http11BaseProtocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Jul 27, 2008 5:31:59 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Jul 27, 2008 5:31:59 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/47 config=null Jul 27, 2008 5:32:00 PM org.apache.catalina.storeconfig.StoreLoader load INFO: Find registry server-registry.xml at classpath resource Jul 27, 2008 5:32:00 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 1156 ms Jul 27, 2008 5:32:08 PM org.apache.catalina.core.ApplicationContext log INFO: Marking servlet HelloWorld as unavailable Jul 27, 2008 5:32:08 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Allocate exception for servlet HelloWorld java.lang.ClassCastException: mngeclipse714.HelloWorld at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1089) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595)
I had a look at the attached sample project. This is a bug in WTP tomcat server support and unfortunately there is not much we can do from m2e side to solve the problem. I've submitted https://bugs.eclipse.org/bugs/show_bug.cgi?id=242476 together with proposed fix. In the mean time, you can disable "Serve modules without publishing" as a workaround.
We still need a sample project and steps to reproduce the problem from the original report (i.e. EAR/JBoss support).
Why not simply have a different library for each scope?
Right now, there is just "Maven Dependencies" with everything, regardless of scope (screenshot).
Instead of excluding, just deploy the compile and runtime libraries.
Then the eclipse bug becomes a non-issue.
It would also make things much simpler for users, they can explicitly see what is and isn't being deployed.
Because of this issue, m2eclipse is unusable by my entire team. I'd love to get them on it but, if they can't run code from the dev environment.....
sample-eclipse-projects.zip contains sample code with corresponding poms by means you may reproduce the problem that the m2eclipse plugin packages provided libraries into the ear.
This zip file contains following eclipse projects which are packaged to the one resulting ear.
- sample-ear
- sample-ejb
- sample-ejb-client-view
- sample-ejb-client
- sample-web
The second attachment "ear_produced_by_maven_pure.ear" is the result when we run mvn install on sample-ear. It can be deployed to JBoss 4.2
The third attachment "ear_produced_by_wtp_m2plugin.ear" is the result when we use the m2eclipse Plugin in combination with WTP. It cannot be deployed to JBoss because provided libraries (log4j and j2ee.jar) are packaged as well. We checked just "Maven Dependencies" in the Java EE module Dependencies.
eclipse Version: 3.4.0, I20080617-2000
m2eclipse: 0.9.6.20080822-1053
We cannot use the m2eclipse plugin as far as this issue will be solved.
Thanks in advance, Ulrike
Ulli, according to WTP bug 242476 submitted by Igor, the root of the issue been fixed in WTP 3.0.2 and 3.1 steams. You can download and install WTP integration build with that fix from http://build.eclipse.org/webtools/committers/
Just to clarify, fix for wtp #242476 is specific to Tomcat server adaptor and does not help with ear export. When we add EAR support (MNGECLIPSE-688), we need to make sure we properly deal with provided scope.
What do you mean by "we need to make sure we properly deal with provided scope"?
We just want that libraries with scope provided are not packaged into the ear / war.
I've just updated to WTP 3.0.2 and also updated Maven Integration for Eclipse / WTP to 0.9.6.20080905-0917.
Unfortunately the result remains the same – the exported ear contains all provided libraries.
I would like to use the plugin, it eases a lot of development aspects. I don't understand all the details described in http://jira.codehaus.org/browse/MNGECLIPSE-688 – is the plugin ready to tackle with ejb3.0 and ear 5.0?
If not – is there a plan when it will do?
Thanks in advance, Ulrike
Since WTP 3.0.2 is available I have done a new installation of eclipse Ganymede with WTP 3.0.2 and the newest version of m2eclipse (0.9.6.20080905-0917).
I would like to attest that this issue is fixed in case of web projects (also web projects packaged into an ear) – but unfortunately this issue remains for ejb and utility projects.
You can reproduce this if your ejb project depends on provided libraries. If you use the WTP server view to publish to the application server (in our case JBoss 4.x) you will see that afterwards all provided libraries are contained in the ear which is placed in the deploy folder of the application server. To illustrate that it I have attached a zip with an eclipse ejb project and an eclipse ear project. Don't forget to configure the JBoss runtime.
The issue is still there in my installation (WTP 3.0.2, plugin v.0.9.6.20080905-0917). Published WAR contains the mail.jar, activation.jar, and servlet-api.jar, all of those have been marked as "provided". Changing them to "compile" didn't fix the problem, either.
Hi,
this issue should be fixed in the latest stable dev version (starting from 0.9.7.20081001-2217). You can update your m2eclipse plugin here http://m2eclipse.sonatype.org/update-dev/
You can check provided dependencies are not exported with the following test project, from m2eclipse test suite :
http://svn.sonatype.org/m2eclipse/trunk/org.maven.ide.eclipse.wtp.tests/projects/MNGECLIPSE-688/pom14-1/
You can import the project directly from eclipse by left clicking on the projects view and :
- New > Other > Maven > Checkout as Maven Project from SCM,
- choose svn from the combobox
- enter the project's url.
regards
Fred Bricon
"Should be" fixed, or was it really fixed? I've created a fresh install of Eclipse 3.4.1 and WTP 3.0.2, plus the latest plugin version (0.9.7.20081008-1902), and the problem is still there. I'll attach the project I've been using
Deployed this project to a local Tomcat 5.5.26 environment. All four dependencies ended up in the WEB-INF/lib folder.
Alex,
I carefully said "should" be fixed, as I didn't extensively test provided dependencies were excluded in all cases. But I had no problems with ejbs or wars ... so far.
I tested your test project on the exact same eclipse config as you, same tomcat version, on Vista. No jars in the lib folder :
Le volume dans le lecteur C s'appelle OS
Le num‚ro de s‚rie du volume est 647A-A855
R‚pertoire de C:\workspaces\mngeclipse-980\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\test
17/10/2008 17:28 <REP> .
17/10/2008 17:28 <REP> ..
17/10/2008 17:24 274 index.html
17/10/2008 17:22 <REP> META-INF
17/10/2008 17:22 <REP> WEB-INF
2 fichier(s) 274 octets
R‚pertoire de C:\workspaces\mngeclipse-980\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\test\META-INF
17/10/2008 17:22 <REP> .
17/10/2008 17:22 <REP> ..
17/10/2008 11:11 39 MANIFEST.MF
1 fichier(s) 39 octets
R‚pertoire de C:\workspaces\mngeclipse-980\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\test\WEB-INF
17/10/2008 17:22 <REP> .
17/10/2008 17:22 <REP> ..
17/10/2008 17:22 <REP> classes
17/10/2008 11:11 631 web.xml
1 fichier(s) 631 octets
R‚pertoire de C:\workspaces\mngeclipse-980\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\test\WEB-INF\classes
17/10/2008 17:22 <REP> .
17/10/2008 17:22 <REP> ..
17/10/2008 17:22 0 log4j.properties
17/10/2008 17:21 <REP> main
1 fichier(s) 0 octets
R‚pertoire de C:\workspaces\mngeclipse-980\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\test\WEB-INF\classes\main
17/10/2008 17:21 <REP> .
17/10/2008 17:21 <REP> ..
17/10/2008 17:21 <REP> webapp
0 fichier(s) 0 octets
R‚pertoire de C:\workspaces\mngeclipse-980\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\test\WEB-INF\classes\main\webapp
17/10/2008 17:21 <REP> .
17/10/2008 17:21 <REP> ..
0 fichier(s) 0 octets
Total des fichiers list‚sÿ:
5 fichier(s) 944 octets
17 R‚p(s) 89ÿ992ÿ302ÿ592 octets libres
I just added an index.html to check synchronization was ok.
I also exported the project as a war file, no provided jars either.
I'm a bit puzzled concerning your issue. Has anyone else reproduced the bug?
regards,
Fred Bricon
Here's the contents of my deploy folder. As you can see, the libs are there. Also, my location of Eclipse is C:\Downloads\eclipse-3.4.1, and the workspace is located right underneath (C:\Downloads\eclipse-3.4.1\Work), maybe this is what causes it? To be honest, I have no clue why is it different for your environment - the install is completely fresh, just beamed it down few hours ago...
Hi Fred
Please have a look at http://jira.codehaus.org/browse/MNGECLIPSE-950,
to reproduce the bug you can use the example project (ear-ejb-support-new-zip) and follow the steps (described in my comment of 23/Oct/08).
Until this nasty bug isn't fixed we can't use m2eclipse in our WTP projects ...
Please tell me if something isn't clear to you.
Best regards, Ulrike
Ulrike,
I still cannot reproduce your bug with your new test project. I have the same environment as you. I made a slight modification though : ejb project depends on javax.ejb:ejb-api-3.0 as it's available in the public jboss repo
<dependencies>
...
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jboss</id>
<name>JBoss maven repo</name>
<url>http://repository.jboss.org/maven2
</url>
</repository>
</repositories>
The rationale behind this change is people don't have to manually import sun's j2ee artifact into their own repo, so it's easier to test ![]()
When I open EARSupport\org.eclipse.wst.common.component I have the following :
<?xml version="1.0" encoding="UTF-8"?> <project-modules id="moduleCoreId" project-version="1.5.0"> <wb-module deploy-name="EARSupport"> <wb-resource deploy-path="/" source-path="/EarContent"/> <wb-resource deploy-path="/" source-path="/src/main/application"/> <dependent-module deploy-path="/" handle="module:/resource/EARSupportEJB/EARSupportEJB"> <dependent-object/> <dependency-type>uses</dependency-type> </dependent-module> </wb-module> </project-modules>
Apart from the extra "/src/main/application" path that shouldn't be here, you can see no references to any ejb dependencies.
I get no jars in the deployed ear in JBoss folder.
Now, in EARSupportEJB\pom.xml, when changing the scopes from provided to compile, then right clicking on EARSupport > Maven > Update dependencies, the ear .component file changes to
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="EARSupport">
<wb-resource deploy-path="/" source-path="/EarContent"/>
<wb-resource deploy-path="/" source-path="/src/main/application"/>
<dependent-module deploy-path="/" handle="module:/resource/EARSupportEJB/EARSupportEJB">
<dependent-object/>
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module deploy-path="/" handle="module:/classpath/var/M2_REPO/log4j/log4j/1.2.9/log4j-1.2.9.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module deploy-path="/" handle="module:/classpath/var/M2_REPO/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
</wb-module>
</project-modules>
Log4J and ejb-api jars are in the deployed ear.
When changing the scopes back to provided, you absolutly have to click on "update dependencies" for the ear to see the changes. Artifacts are removed from .component, the deployed ear is back to its expected state.
Ulli and Alex, did you create maven projects first or mavenized wtp projects? Can you try to import the projects in a clean workspace after removing their eclipse configuration?
regards,
Fred Bricon
In reply to comment #26:
> When changing the scopes back to provided, you absolutly have to click on
> "update dependencies" for the ear to see the changes.
Fred, we have an event that is notifying project configurators about changes in MavenProject, so we should be able to trigger update dependencies or update project configuration automatically.
Fred,
I mavenized a WTP project, didn't create a new Maven one. Will try the import, hopefully today.
Alex
Ok, I tried creating a new Maven project, but it seems there's no WST/WTP archetype I could find, so my only choice is to mavenize an existing one.
Didn't try the import, either, as I realized there's nothing to import - the project consists of one .property file (existing for the sole reason of seeing the WEB-INF/classes being published, as WTP doesn't publish empty folders).
Anyway, here's the sequence of steps I took, to reproduce it again, with clean environment:
1. Download the Eclipse 3.1.4 (platform runtime & JDT runtime - no SDKs or prepackaged installs) and extract it to a folder (mine was C:\Downloads\eclipse-3.4.1)
2. Using Eclipse update, install WTP (J2EE & Web tools only, version 3.0.2)
3. Install M2E plugin the same way
4. New -> Project -> Dynamic Web project -> name "test" -> Finish
5. Right-click -> Maven -> Enable dependency management -> packaging "war" -> Finish
6. Project properties -> Java Compiler -> compiler compliance level "1.5" (to fix the over-helpful M2E plugin that sets it to 1.4)
7. Project properties -> Java source -> add "src" folder (again, to fix the changes from the stupid plugin that removes the source folder)
8. Project properties -> J2EE module dependencies -> check the Maven dependencies
9. manually add the following to pom.xml:
<dependencies>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
10. add the project to the local Tomcat 5.5 server
11. publish, happily find the libs in the published WEB-INF/lib
In reply to comment #29:
> Ok, I tried creating a new Maven project, but it seems there's no WST/WTP
> archetype I could find, so my only choice is to mavenize an existing one.
What about maven-archetype-webapp archetype, which is also mentioned in our wtp mini howto at http://docs.codehaus.org/display/M2ECLIPSE/WTP+mini+howto
> 3. Install M2E plugin the same way
What update site you are using to install m2eclipse?
> 5. Right-click -> Maven -> Enable dependency management -> packaging "war" ->
> Finish
For the record, this action does not convert any eclipse project settings, and curently only creates dummy Maven project that need to be edited manually
> 6. Project properties -> Java Compiler -> compiler compliance level "1.5" (to
> fix the over-helpful M2E plugin that sets it to 1.4)
The compiler configuration is read from maven-compiler-plugin config in pom.xml and if you don't have one specified there, Maven's defaults are 1.4
> 7. Project properties -> Java source -> add "src" folder (again, to fix the
> changes from the stupid plugin that removes the source folder)
Again, Maven defaults are src/main/java, so if you have different project layout, you need to declare that in your pom.xml (see my comment above about enabling Maven support on the project)
> 8. Project properties -> J2EE module dependencies -> check the Maven
> dependencies
You shouldn't do this and instead should use "Maven / Update project configuration" from the popup menu on your project as Fred already pointed out in the previous comments. Actually you should do that after you add all the dependencies you want in your project.
To be honest, this is not my point. There's an issue which reproduces consistently on my environment, yet fails to show up on Fred's machine. I'm trying to document the exact steps I took, so that Fred could try to do the same and, hopefully, catch the issue. Whether I'm doing it the "Maven-proper" way or not is completely irrelevant - though I do believe that the plugin tries to enforce the "proper" way too much.
BTW, I tried both the regular update site (http://m2eclipse.sonatype.org/update) and the dev one (http://m2eclipse.sonatype.org/update-dev) with the same effect.
Oh, yea, and the "maven-archetype-webapp" doesn't produce a WTP project - it's not recognized as such when trying to deploy it to a local Tomcat server.
Alex, I was simply trying to address your picky comments about current behavior of m2eclipse project configurators.
However, your comment about Maven "war" project is not being recognixed as WTP project makes me wonder... can you please attach your Eclipse configuration details from Help / About Eclipse SDK / Configuration Details. Thanks.
Ok, I think I nailed down the problem - it's the presence of WTP integration plugin. If it's not there, the server deployment is screwed as describedabove. Installing the latest WTP Integration plugin fixed all my publishing issues.
So it seems that the problem wasn't in how the project gets mavenized: without the WTP integration, the project created as WTP wouldn't deploy properly, and the project created as Maven wouldn't even be recognized as WTP; and with WTP integration present, both projects deploy normally
This is the conclusion I was getting into. The WTP integration feature for m2eclipse is required if you want Maven support for WTP projects. Also, after installing WTP integration you should be able to fix your project setup by running Maven / Update project configuration from the popup menu.
Well, it was clearly as much surprise to you as it was to me, wasn't it - and I don't recall any documentation on what exactly the WTP feature does enable. The rest of the integration worked fine without this feature, after all.
Alex, it is kinda natural to expect that user would install WTP support if he is planning to use Maven with WTP. Also, there is a warning about WTP feature on WTP howto page linked from one of the previous comments. Anyway, I suppose this issue is resolved for you now.
Documentation for the WTP integration feature is on the wiki and you are welcome to expand it.
Fred, I refer to your comment from 23/Oct/08 07:47 AM
We also mavenized our existing WTP projects later on.
Indeed – if you activate Maven > Update Dependencies on both projects (ear and ejb), the provided libraries disappear from the ear.
In my point of view this (both triggering of Update Depnendencies) should not be necessary if you start mavenizing a project!
It would be great if this explicit Update Dependencies won't be necessary when enabling Maven. In my opinion a "Update Dependencies" should be necessary only if depencencies are added or changed in the pom later on.
To reproduce this you can follow this steps:
1. Take an EJB Project (if you don't have one you can take it from http://jira.codehaus.org/browse/MNGECLIPSE-950 --> ear-ejb-support-new.zip)
2. Mavenize EJB Project (Maven > Enable Dependency Management)
Add some provided dependencies in the pom
Note this ugly behaviour: If I now want to activate "Maven Dependencies" on Java EE Module Dependencies of the EJB Project, I get a NullPointerException!
2. Take an EAR Project File (if you don't have one you can take it from http://jira.codehaus.org/browse/MNGECLIPSE-950 --> ear-ejb-support-new.zip) – set as module the EJB project
3. Mavenizing EAR Project (Maven > Enable Dependency Management)
=> If you go to Java EE Module Dependencies from the EAR project: You will see in grey color also the provided libraries
Note: If I now activate "Maven Dependencies" on Java EE Module Dependencies of the EJB Project, I get no NullPointerException
To avoid having provided libraries in the ear, I had to do Maven > Update Dependency on both projects.
Thanks for pushing this issue!
Ulrike
Hi Fred,
I tried to do the same (invoke "update dependencies" on projects) with the attached demo-sample-ejb-ear.support.zip.
Unfortunately I have no chance to make it running with WTP.
Either all libraries are contained in the ear (provided and compile time libraries) or
the manifest of the sample-ejb project is empty so that the application server can't find the libraries at runtime.
Please note that the ejb project (sample-ejb) has provided and compile time libraries.
The ear should consist of following modules:
- sample-ejb (for testing also with junit.jar)
- sample-ejb-client
- sample-ejb-client-view
- sample-web
Please note that every time I activate Maven > Update Project Configuration, the JEE Module Dependencies of the projects are changed to Unable to render embedded object: File (no Maven Dependencies) not found. and the Compiler Settings are set to the default Compiler settings instead of the project specific Compiler settings. The going is a little bit tough ...
Thanks for your hints,
kind regards, Ulrike
Last stable dev-build is 0.9.7.200810211352 / October 21, 2008 (problem still exists)
When will "fix version" 0.9.8 be available?
As far as I know, m2e does not support EAR and does not do packaging, so I am not sure what you do and what exactly happens. Are you running Maven->Package goal using embedded maven or do something else? Can you provide more details?