users@glassfish.java.net

appclient fails with ClassNotFoundException

From: <glassfish_at_javadesktop.org>
Date: Mon, 19 Apr 2010 03:15:14 PDT

I'm stumped as to what to try next and would appreciate any ideas on what could be causing this error.

When running "appclient -client <jar>" against client stubs downloaded using "asadmin get-client-stubs" I get a ClassNotFoundException, however the class does reside in one of the jars downloaded and included in the created sub directory.

I'm using the latest glassfish nightly: glassfish-v3_1-b01-04_18_2010.zip
I can reproduce it in Glassfishv3 final though.

The ClassNotFoundException refers to a remote interface being injected into the main class.
The very simple main class is:

---
import javax.ejb.EJB;
public class AppClientMain {
    @EJB
    private static BuildInfoBeanRemote buildInfoBean;
    public static void main(final String[] args) {
        System.out.println(buildInfoBean.getManifestContent());
    }
}
---
The full stacktrace is:
---
19/04/2010 7:46:24 PM 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: Lau/projectx/BuildInfoBeanRemote;
	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:658)
	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:351)
	at org.glassfish.appclient.client.acc.AppClientContainer.prepare(AppClientContainer.java:312)
	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: au.projectx.BuildInfoBeanRemote
	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:315)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
	... 18 more
FATAL ERROR in native method: processing of -javaagent failed
Abort trap
[Message sent by forum member 'cosmic']
http://forums.java.net/jive/thread.jspa?messageID=397767