2 Replies Latest reply on Dec 14, 2008 3:52 PM by alrubinger

    RuntimeException / ClassNotFoundException when trying to inv

    f10

      Trying to migrate from 4.2.1GA to jboss-5.0.0.GA (jdk6 download) my app finally seems to deploy fine but I get the following exception on the client side (swing client):

      2008-12-14 13:10:31,895 11537 [SwingWorker-pool-32681756-thread-1] DEBUG com.myorg.My.mypackage.MyLoginService - authenticate(String username=root, char[] password=[C@1c293f8, String server=null) - start
      2008-12-14 13:10:31,930 11572 [SwingWorker-pool-32681756-thread-1] DEBUG com.myorg.My.util.ServerContext - getInitialContext() - start
      2008-12-14 13:10:32,310 11952 [SwingWorker-pool-32681756-thread-1] DEBUG com.myorg.My.util.ServerContext - getInitialContext() - initialContext.getEnvironment.get(Context.PROVIDER_URL) = localhost, initialContext.getEnvironment().get(Context.SECURITY_PRINCIPAL) = null, initialContext.getEnvironment().get(Context.SECURITY_CREDENTIALS) = null
      2008-12-14 13:10:32,311 11953 [SwingWorker-pool-32681756-thread-1] DEBUG com.myorg.My.util.ServerContext - getInitialContext() - end - return value=javax.naming.InitialContext@27cd63
      2008-12-14 13:10:32,312 11954 [SwingWorker-pool-32681756-thread-1] DEBUG com.myorg.My.mypackage.MyClientCtrl - getClientSession() - start
      2008-12-14 13:10:32,342 11984 [SwingWorker-pool-32681756-thread-1] DEBUG com.myorg.My.mypackage.MyClientCtrl - getClientSession() - looking up My/ClientSessionBean/remote
      2008-12-14 13:10:32,343 11985 [SwingWorker-pool-32681756-thread-1] DEBUG com.myorg.My.util.ServerContext - getInitialContext() - start
      2008-12-14 13:10:32,343 11985 [SwingWorker-pool-32681756-thread-1] DEBUG com.myorg.My.util.ServerContext - getInitialContext() - initialContext.getEnvironment.get(Context.PROVIDER_URL) = localhost, initialContext.getEnvironment().get(Context.SECURITY_PRINCIPAL) = null, initialContext.getEnvironment().get(Context.SECURITY_CREDENTIALS) = null
      2008-12-14 13:10:32,344 11986 [SwingWorker-pool-32681756-thread-1] DEBUG com.myorg.My.util.ServerContext - getInitialContext() - end - return value=javax.naming.InitialContext@27cd63
      2008-12-14 13:10:32,378 12020 [SwingWorker-pool-32681756-thread-1] DEBUG org.jnp.interfaces.TimedSocketFactory - createSocket, hostAddr: localhost/127.0.0.1, port: 1099, localAddr: null, localPort: 0, timeout: 0
      2008-12-14 13:10:33,639 13281 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.ejb3.proxy.objectfactory.ProxyObjectFactory - org.jboss.ejb3.proxy.objectfactory.ProxyObjectFactory servicing request for My/ClientSessionBean/remote
      2008-12-14 13:10:36,348 15990 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.remoting.transport.socket.MicroSocketClientInvoker - SocketClientInvoker[13dcd27, socket://localhost:3873] constructed
      2008-12-14 13:10:36,350 15992 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.remoting.MicroRemoteClientInvoker - SocketClientInvoker[13dcd27, socket://localhost:3873] connecting
      2008-12-14 13:10:36,350 15992 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.remoting.transport.socket.MicroSocketClientInvoker - Creating semaphore with size 50
      2008-12-14 13:10:36,397 16039 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.remoting.MicroRemoteClientInvoker - SocketClientInvoker[13dcd27, socket://localhost:3873] connected
      2008-12-14 13:10:37,402 17044 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.remoting.transport.socket.ClientSocketWrapper - reset timeout: 0
      2008-12-14 13:10:39,577 19219 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.remoting.InvokerRegistry - removed SocketClientInvoker[13dcd27, socket://localhost:3873] from registry
      2008-12-14 13:10:39,583 19225 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.remoting.transport.socket.MicroSocketClientInvoker - SocketClientInvoker[13dcd27, socket://localhost:3873] disconnecting ...
      2008-12-14 13:10:39,584 19226 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.remoting.transport.socket.SocketWrapper - ClientSocketWrapper[Socket[addr=/127.0.0.1,port=3873,localport=33225].17af46e] closing socket
      2008-12-14 13:10:39,587 19229 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.remoting.transport.socket.SocketWrapper - ClientSocketWrapper[Socket[addr=/127.0.0.1,port=3873,localport=33225].17af46e] closed socket
      2008-12-14 13:10:39,588 19230 [SwingWorker-pool-32681756-thread-1] DEBUG org.jboss.ejb3.proxy.objectfactory.session.SessionProxyObjectFactory - Created Proxy of type $Proxy1 for EJB3 Business Interface: com.myorg.My.business.ClientSession
      2008-12-14 13:10:39,657 19299 [SwingWorker-pool-32681756-thread-1] DEBUG com.myorg.My.mypackage.MyClientCtrl - getClientSession() - end - return value=Proxy to jboss.j2ee:ear=My.ear,jar=business.jar,name=ClientSessionBean,service=EJB3 implementing [interface org.jboss.ejb3.proxy.intf.SessionProxy, interface com.myorg.My.business.ClientSession, interface org.jboss.ejb3.proxy.intf.StatefulSessionProxy, interface org.jboss.ejb3.proxy.intf.EjbProxy]
      2008-12-14 13:10:39,669 19311 [SwingWorker-pool-32681756-thread-1] ERROR com.myorg.My.mypackage.MyLoginService - authenticate(String, char[], String)
      java.lang.RuntimeException: Specified calling class, [C could not be found for sun.misc.Launcher$AppClassLoader@7d772e
      at org.jboss.ejb3.common.lang.SerializableMethod.getClassFromName(SerializableMethod.java:348)
      at org.jboss.ejb3.common.lang.SerializableMethod.toMethod(SerializableMethod.java:238)
      at org.jboss.ejb3.common.lang.SerializableMethod.toMethod(SerializableMethod.java:219)
      at org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:236)
      at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101)
      at $Proxy2.getAndAuthenticateAccountByUsernameAndPassword(Unknown Source)
      at com.myorg.My.mypackage.MyLoginService.authenticate(MyLoginService.java:47)
      at org.jdesktop.swingx.auth.LoginService$1.doInBackground(LoginService.java:142)
      at org.jdesktop.swingworker.SwingWorker$1.call(SwingWorker.java:276)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at org.jdesktop.swingworker.SwingWorker.run(SwingWorker.java:315)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.ClassNotFoundException: [C
      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 java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at org.jboss.ejb3.common.lang.SerializableMethod.getClassFromName(SerializableMethod.java:344)
      ... 14 more

      The method to be invoked is from the ClientSessionBean/remote interface.
      Any ideas?

      Env:
      # java -version
      java version "1.6.0_10"
      Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
      Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
      # uname -r
      2.6.26-1-686

      Thx in advance.

        • 1. Re: RuntimeException / ClassNotFoundException when trying to
          alrubinger

          Thanks for reporting this.

          2008-12-14 13:10:39,669 19311 [SwingWorker-pool-32681756-thread-1] ERROR com.myorg.My.mypackage.MyLoginService - authenticate(String, char[], String)
          java.lang.RuntimeException: Specified calling class, [C could not be found for sun.misc.Launcher$AppClassLoader@7d772e
           at org.jboss.ejb3.common.lang.SerializableMethod.getClassFromName(SerializableMethod.java:348)
          


          Running the Unit Tests under JDK6 for the ejb3-common project show this failure as well.

          https://jira.jboss.org/jira/browse/EJBTHREE-1622

          You can put a watch on the issue for updates. ;)

          In the meantime, you can workaround by:

          * Running in JDK5
          * Moving your primitives to wrappers (ie. char[] > java.lang.Character[])

          S,
          ALR

          • 2. Re: RuntimeException / ClassNotFoundException when trying to
            alrubinger

            Ah, the ClassLoader Array Syntax thing.

            http://bugs.sun.com/view_bug.do?bug_id=6434149

            You can also do:

            -Dsun.lang.ClassLoader.allowArraySyntax=true


            ...in System properties to workaround.

            "ALRubinger" wrote:
            * Moving your primitives to wrappers (ie. char[] > java.lang.Character[])


            That's untrue. I misread the problem as dealing w/ primitives, but it's arrays.

            I've committed the fix to ejb3-common and this will be available in the next release.

            S,
            ALR