File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Java Products and Servers and the fly likes JEE 5 tutorial example - clientsessionmdb - isue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "JEE 5 tutorial example - clientsessionmdb - isue" Watch "JEE 5 tutorial example - clientsessionmdb - isue" New topic
Author

JEE 5 tutorial example - clientsessionmdb - isue

Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Hi,

I am trying clientsessionmdb example on GV v3 but I can not get it works.

I get the following exception,

<quote>
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
</quote>

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
Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
In the second line of my initial post I was meaning GF v3.

Googling I have found the following explanation about this issue at,

[Issue 9068][standalone-client]

But I feel a little lost about that what is exposed.

At the end of the conversation I have found the open issue in glassfish

[#GLASSFISH-9092]

but in a few words, what are the trying to mean?

Any help should be appreciated!!!

Thanks in advance,
Jose
Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Hi,

At the end I have decided to install GF v2.1.1 and try the application on it and the app works as was expected.

Thanks a lot,
Jose
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JEE 5 tutorial example - clientsessionmdb - isue
 
Similar Threads
java.lang.NoClassDefFoundError
JMX Connections within Eclipse?
NoInitialContextException
Newb EE deployment / exec questions - app client - EJB class not found exception.
JMX Connections within Eclipse?