Skip to main content

JEE 5 clientsessionmdb example (JMS)

1 reply [Last post]
josealvarezdelara
Offline
Joined: 2008-12-26
Points: 0

Hi,
I am trying clientsessionmdb example but I can not get it works.
I get the following exception,
<code>
12-ene-2011 10:39:05 com.sun.enterprise.transaction.JavaEETransactionManagerSimplified initDelegates
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
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: Lsb/PublisherRemote;
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)
FATAL ERROR in native method: processing of -javaagent failed
at org.glassfish.appclient.client.acc.agent.AppClientContainerAgent.premain(AppClientContainerAgent.java:75)
... 6 more
Caused by: java.lang.ClassNotFoundException: sb.PublisherRemote
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.glassfish.appclient.client.acc.ACCClassLoader.findClass(ACCClassLoader.java:211)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 18 more
Exception in thread "main" Java Result: 1
</code>
And it is something estrange because as the exception says "Caused by: java.lang.NoClassDefFoundError: Lsb/PublisherRemote;"
there is not any calling to "Lsb/PublisherRemote". In fact the PublisherRemote is in the packege sb (Session Bean)
The ear includes an -ejb.jar that contains the session bean and a MDB and on the other hand exists a appclient.jar that looks as follows,
<code>
public class MyAppClient {
@EJB(name = "PublisherRemote")
private static PublisherRemote publisher;

public static void main(String[] args) {
MyAppClient client = new MyAppClient();
client.doTest();
System.exit(0);
}

public void doTest() {
try {
if(null != publisher) {
publisher.publishNews();
publisher.publishNews();
System.out.println("To view the bean output,");
System.out.println(
" check <install_dir>/domains/domain1/logs/server.log.");
} else {
System.out.println("publisher is null!!!");
}
} catch (Exception ex) {
System.out.println("Exception: " + ex.getMessage());
ex.printStackTrace();
}
}
}
</code>
The if clause in the doTest() method is mine to test if publisher is not injected correctly.
If need more code let me know it and I post it.
Thanks in advance,
Jose

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
josealvarezdelara
Offline
Joined: 2008-12-26
Points: 0

Hi,
I have found a web that tries to explain the issue at,
markmail.org/message/njnnlktq6q4f55v5#query:clientsessionmdb%20java.lang.NoClassDefFoundError%3A%20Lsb%2FPublisherRemote+page:1+mid:njnnlktq6q4f55v5+state:results

It is a conversation between two people that takes at the end to open an issue in Glassfish
but it is hard to understand.

I would really appreciate if anyone should take a look at those web pages and should help me.

Regards,
Jose