Hi,
sorry if this question has been asked before, but the search function of the
forum seems to be broken. I get zero hits, no matter what search term I use.
I'm starting to code an application for Glassfish 3.0.1 with Eclipse on
Windows 7. I created the following projects so far in Eclipse:
* an EJB module containing a single session bean
* an EJB client project containing a remote interface for the session bean
* a JPA project containing an entity
* a dynamic web project with a JSF page and a backing bean, using PrimeFaces
* an application client project
All this projects go int an EAR file. I can deploy this to Glassfish
successfully and the web application runs fine.
But it does not work to get the client JAR with get-client-stubs and to run
it with appclient.
When I export an EAR file explicitly from Eclipse, it has the following
structure:
PS C:\Users\stm\tmp> jar tvf .\sprint-ear.ear 25 Wed Nov 10 21:38:22 CET 2010
META-INF/MANIFEST.MF 2598 Wed Nov 10 21:38:22 CET 2010 sprint-ejb.jar 1358
Wed Nov 10 21:38:22 CET 2010 sprint-ejbClient.jar 42490 Wed Nov 10 21:38:22
CET 2010 sprint-web.war 2835 Wed Nov 10 21:38:22 CET 2010
lib/sprint-entity.jar 1318 Wed Nov 10 21:38:22 CET 2010 sprint-appClient.jar
0 Sun Nov 07 20:44:22 CET 2010 lib/ 2018651 Thu Oct 21 20:48:08 CEST 2010
lib/primefaces-2.2.M1.jar
What I get with get-client-stubs looks like this:
sprint-earClient.jar
sprint-earClient\sprint-appClient.jar
sprint-earClient\sprint-appClientClient.jar
sprint-earClient\lib\primefaces-2.2.M1.jar
The sprint-appClientClient.jar file contains the following:
PS C:\Users\stm\Documents\GIT\sprint\sprint-runApp> jar tvf
sprint-earClient\sprint-appClientClient.jar 499 Sun Nov 07 20:45:06 CET 2010
META-INF/MANIFEST.MF 767 Sun Nov 07 20:45:06 CET 2010
META-INF/application-client.xml 567 Sun Nov 07 20:45:06 CET 2010
META-INF/sun-application-client.xml 19180 Sun Nov 07 20:45:06 CET 2010
org/glassfish/appclient/client/AppClientFacade.class
When I try to run the application client, I get the following exception:
PS C:\Users\stm\Documents\GIT\sprint\sprint-runApp>
C:\glassfishv3\glassfish\bin\appclient.bat -client
.\sprint-earClient\sprint-appClientClient.jar 10.11.2010 21:48:57
com.sun.enterprise.transaction.JavaEETransactionManagerSimplified
initDelegates INFO: Using
com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the
delegate
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
at
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
Caused by: java.lang.NoClassDefFoundError:
Lcom/pluginsmithy/sprint/ejb/PrintScheduleBeanRemote;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredField(Class.java:1880)
at
com.sun.enterprise.deployment.util.DefaultDOLVisitor.acceptWithCL(DefaultDOLVisitor.java:350)
at
com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:188)
at
com.sun.enterprise.deployment.ApplicationClientDescriptor.visit(ApplicationClientDescriptor.java:657)
at
com.sun.enterprise.deployment.archivist.AppClientArchivist.validate(AppClientArchivist.java:168)
at
org.glassfish.appclient.client.acc.FacadeLaunchable.validateDescriptor(FacadeLaunchable.java:175)
at
org.glassfish.appclient.client.acc.AppClientContainer.completePreparation(AppClientContainer.java:350)
at
org.glassfish.appclient.client.acc.AppClientContainer.prepare(AppClientContainer.java:311)
at
org.glassfish.appclient.client.AppClientFacade.prepareACC(AppClientFacade.java:264)
at
org.glassfish.appclient.client.acc.agent.AppClientContainerAgent.premain(AppClientContainerAgent.java:75)
... 6 more
Caused by: java.lang.ClassNotFoundException:
com.pluginsmithy.sprint.ejb.PrintScheduleBeanRemote
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at
org.glassfish.appclient.client.acc.ACCClassLoader.findClass(ACCClassLoader.java:211)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
... 18 more
The class with the remote interface is obviously not included in the
downloaded client stubs JAR file. What am I'm doing wrong? From the
documentation of get-client-stubs it sounds to me that all necessary JAR
files to run the client application should be included in the downloaded JAR
file.
Thanks
Stephan
--
[Message sent by forum member 'smuehlst']
View Post: http://forums.java.net/node/715589