8 Replies Latest reply on Jun 17, 2010 5:52 AM by alkod

    Newbie and problematic

    zoeley

      Hi, I'm trying to run a client application but I have the following error:

      Using: Jboss 5.1.0, JDK 1.6_18 and maven 2.2.1

       

      DEBUG [main] (
      Logger.java:228) - createSocket, hostAddr: /127.0.0.1, port: 1099, localAddr: null, localPort: 0, timeout: 0 DEBUG [main] (
      Logger.java:228) - org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory servicing request for PersonaBean/remote DEBUG [main] (
      Logger.java:228) - SocketClientInvoker[1b16e52, socket://localhost:3873] constructed DEBUG [main] (
      Logger.java:228) - SocketClientInvoker[1b16e52, socket://localhost:3873] connecting DEBUG [main] (
      Logger.java:228) - Creating semaphore with size 50 DEBUG [main] (
      Logger.java:228) - SocketClientInvoker[1b16e52, socket://localhost:3873] connected DEBUG [main] (
      Logger.java:228) - removed SocketClientInvoker[1b16e52, socket://localhost:3873] from registry DEBUG [main] (
      Logger.java:228) - SocketClientInvoker[1b16e52, socket://localhost:3873] disconnecting ... DEBUG [main] (
      Logger.java:228) - Created Proxy of type $Proxy1 for EJB3 Business Interface: unsj.hre_ejb.ir.PersonaRemote DEBUG [main] (
      Logger.java:228) - Couldn't handle invocation directly within org.jboss.ejb3.proxy.impl.handler.session.SessionRemoteProxyInvocationHandler@1ce2dd4: Current invocation "public abstract java.lang.String unsj.hre_ejb.ir.PersonaRemote.buscarPersona()" is not eligible for direct handling by org.jboss.ejb3.proxy.impl.handler.session.SessionRemoteProxyInvocationHandler@1ce2dd4 DEBUG [main] (
      Logger.java:228) - Received invocation request to method unsj.hre_ejb.ir.PersonaRemote: unsj.hre_ejb.ir.PersonaRemote.buscarPersona(); using hash: -4133175750733962837 DEBUG [main] (
      Logger.java:228) - Using ThreadLocal: false  Exception in thread "main"
      java.lang.reflect.UndeclaredThrowableException   at $Proxy2.buscarPersona(Unknown Source)
      at Zzapp.main(
      Zzapp.java:39) Caused by:
      java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException at java.security.AccessController.doPrivileged(
      Native Method) at org.jboss.ejb3.security.client.SecurityActions.createSecurityContext(
      SecurityActions.java:657) at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(
      SecurityClientInterceptor.java:59) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
      MethodInvocation.java:102) at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(
      IsLocalInterceptor.java:74) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
      MethodInvocation.java:102) at org.jboss.aspects.remoting.PojiProxy.invoke(
      PojiProxy.java:62) at $Proxy3.invoke(Unknown Source)
      at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(
      SessionProxyInvocationHandlerBase.java:207) at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(
      SessionProxyInvocationHandlerBase.java:164) ... 2 more
      Caused by:
      java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(
      Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(
      NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
      DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(
      Constructor.java:513) at org.jboss.security.SecurityContextFactory.createSecurityContext(
      SecurityContextFactory.java:117) at org.jboss.security.SecurityContextFactory.createSecurityContext(
      SecurityContextFactory.java:76) at org.jboss.ejb3.security.client.SecurityActions$1.run(
      SecurityActions.java:662) ... 12 more
      Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file
      javax/security/jacc/PolicyContextException at java.lang.ClassLoader.defineClass1(
      Native Method) at java.lang.ClassLoader.defineClassCond(
      ClassLoader.java:632) at java.lang.ClassLoader.defineClass(
      ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(
      SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(
      URLClassLoader.java:283) at java.net.URLClassLoader.access$000(
      URLClassLoader.java:58) at java.net.URLClassLoader$1.run(
      URLClassLoader.java:197) at java.security.AccessController.doPrivileged(
      Native Method) at java.net.URLClassLoader.findClass(
      URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(
      ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(
      Launcher.java:301) at java.lang.ClassLoader.loadClass(
      ClassLoader.java:248) at org.jboss.security.plugins.JBossSecurityContext.<init>(
      JBossSecurityContext.java:82) ... 19 more
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      

       

      I hope that somebody will have a solution.
      Thanks in advance.

       

      Zoeley

        • 1. Re: Newbie and problematic
          jaikiran
          Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file
          javax/security/jacc/PolicyContextException

          Can you please give a bit more details about your application? Including how you invoke the bean, where the client is located, is it a standalone client, which version of JBoss AS and Java?

          • 2. Re: Newbie and problematic
            zoeley

            It's a standalone client. I'm using Jboss 5.1.0, JDK 1.6_18 and maven 2.2.1.

            The code of the app it's here:

             

            Thank you!

             

            Noelia

             

             

            public

             

             

            static void

            main(String[] args) {

             

             

            PersonaRemote int_remota;

            String personas_res;

             

             

             

            try

            {

             

            InitialContext ctx =

             

            new

            InitialContext();

             

            int_remota = (PersonaRemote) ctx.lookup(

             

            "PersonaBean/remote"

            );

            personas_res = int_remota.buscarPersona();

             

            System.

             

            out.print("nombre persona"

            + personas_res);

             

            }

             

            catch

            (NamingException ne) {

            System.

             

            out.print("Error: "

            + ne);

            • 3. Re: Newbie and problematic
              wolfgangknauf

              {quote}Caused by: java.lang.ClassFormatError: Absent Code attribute in method  that is not native or abstract in class file
              javax/security/jacc/PolicyContextException{quote}

               

              This sounds like a Maven issue. E.g. take a look at this: http://weblogs.java.net/blog/ludo/archive/2007/01/java_ee_5_apis.html

              Is there some maven generated javaee stub jar deployed to your jboss?

               

              Best regards

               

              Wolfgang

              1 of 1 people found this helpful
              • 4. Re: Newbie and problematic
                zoeley

                Hi, the pom.xml of my ejb jar has this:

                 

                <dependency>

                <groupId>javax</groupId>

                <artifactId>javaee-api</artifactId>

                <version>6.0</version>

                <scope>provided</scope>

                </dependency>

                 

                Thanks for responding

                 

                Noelia

                • 5. Re: Newbie and problematic
                  zoeley

                  Hi, Wolfgang, I want to thank you, it's was a problem with dependencies. It's working now... THANKS YOU!!

                   

                  Noelia

                  • 6. Re: Newbie and problematic
                    alkod

                    Hello, Noelia, could you please give a hint on what exactly you changed to solve the problem? I'm stuck due to a very similar problem and right now I just don't know what to change...

                    • 7. Re: Newbie and problematic
                      zoeley

                      Hello, Dominik, I checked each dependency in the pom.xml and removed javaee.jar dependecy. I wish this were helpful.

                       

                      Regards

                       

                      Noelia

                      • 8. Re: Newbie and problematic
                        alkod

                        Thanks for your quick answer. However, as I need the java ee libraries for compilation I couldn't just remove the corresponding dependency. Instead, I ended up using a java ee dependency provided by jboss:

                        <dependency>
                          <groupId>org.jboss.javaee</groupId>
                          <artifactId>jboss-javaee</artifactId>
                          <version>5.0.1.GA</version>
                        </dependency>