• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JEE 5 tutorial example - clientsessionmdb - isue

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic