This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
For the following EAR project: cart cart-app-client cart-ejb running the project fails with a NoClassFoundException because the EJB JAR included in the EAR project wasn't retrieved after deployment. In Java EE 6, the Class-Path element of the app client's MANIFEST.MF must specify the other modules. In this case, cart-app-client's MANIFEST.MF is: Manifest-Version: 1.0 Main-Class: cart.client.CartClient Class-Path: cart-ejb.jar This MANIFEST.MF file is overwritten when building, deploying, and running the EAR. Using directory deployment, this is the dist/gfdeploy/cart/cart-app-client_jar/META-INF/MANIFEST.MF: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.7.1 Created-By: 14.2-b01 (Sun Microsystems Inc.) Main-Class: cart.client.CartClient Note that the Class-Path element has been removed. Therefore, cart-ejb.jar is not retrieved when running the project. Here's the contents of dist/cartClient: ilford:cart $ ls dist/cartClient cart-app-client.jar cart-app-clientClient.jar cartClient.jar
Created attachment 89582 [details] Zip file of cart project.
Created attachment 89583 [details] Log file
It looks like this change might be contributing to this problem... http://hg.netbeans.org/main-golden/diff/5261ee988aba/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/build-impl.xsl The change at 1.27/1.28 in this diff seems to be the culprit... I think that the changes that fixed 163971 and 173195 might have been too much...
1bac66b7e368 OK, I reverted my previous change in build-impl.xsl as it does not make any sense for AppClient (change was relevant only for WAR and EJB). This is more of a hotfix rather then proper resolution. One thing which still does not work for me is this: create AppClient and add some Java Class Library project and use this Java project from AppClient and then try to deploy AppClient - I always get java.lang.NoClassDefFoundError for any class from Java Class Library project despite that JAR being available in EAR's root and despite it being correctly referenced via ClassPath entry in AppClient's manifest. Any hint what's wrong in this case Vince?
start by looking at the content of the domains/domain1/generated/xml/<appname>/<appclientname>... after you use nb to deploy the app. compare the content of that directory (actually.. you may want to look at the content of domains/domain1/generated/xml/<appname>) with the content of that directory after doing a directory deployment of the project with asadmin... I can dig into it in more detail on Tuesday.
Integrated into 'main-golden', will be available in build *200910170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/1bac66b7e368 User: David Konecny <dkonecny@netbeans.org> Log: #174708 - partial fix to improve current state; proper fix TBD
This is content of my EAR archive I created in NB (after some build script changes): * /lib/entities.jar - Java Class Project defining Address JPA entity * /ejbs.jar - EJB project providing AddressFacade stateless session bean for accessing Address JPA entity (let's say it has single method "List<Address> findAll()") * /appclient.jar - AppClient project which is using AddressFacade EJB Now, in this case what do you expect to be in manifest file for appclient.jar? "EE.8.3.3 chapter of EE6 spec" says that "Components in the application client container must have access to the following classes and resources: The transitive closure of any libraries specified by or referenced by the containing ear file" - I interpret it that appclient.jar will have automatically access to /lib/entities.jar (jar is in EAR's lib folder). So I changed ClassPath manifest entry in appclient.jar to conctain only ejbs.jar but I'm still getting NoClassDefFoundError exception. Adding entities.jar to ClassPath manifest entry does not help either. So how should I package my appclient?
What happens if you change appclient.jar's MANIFEST.MF to the following? Class-Path: ejbs.jar lib/entities.jar
I tried "Class-Path: ejbs.jar lib/entities.jar" and also "Class-Path: ejbs.jar entities.jar" but none seems to work - result is always NoClassDefFoundError exception.
I need an advice from GF team on this one, so I filed https://glassfish.dev.java.net/nonav/issues/show_bug.cgi?id=10458
It was acknowledged as GF issue and there should be no problem on NB side. I'm waiting for GF issue to get resolved before closing this one.
This has been resolved but I'm waiting for https://glassfish.dev.java.net/nonav/issues/show_bug.cgi?id=10458 to get resolved before I can verify it. Till then AppClient start does not work.
I pushed back my original changes (90a104a53e7d) which should be OK and filed bug 176742 for Vince as sometimes deployment fails from IDE.