java.lang.NoSuchMethodError: javassist.util.proxy.ProxyFactory.isProxyClass(Ljava/lang/Class;)Z.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.NoSuchMethodError: javassist.util.proxy.ProxyFactory.isProxyClass(Ljava/lang/Class;)Z.

akshit
Hi,
In my project I am testing a method of EJB using a JUnit class. So to obtain the reference and create a local environment I used openEJB 3.0. And for using it, I create a java class where I have set properties related to openEJB connection. I have also registered an aspect in aop.xml and have added the project, containing aop.xml, in the build path. Kindly find the stack trace below. Especially what is the meaning of error: NoSuchMethodError:  java.lang.NoSuchMethodError: javassist.util.proxy.ProxyFactory.isProxyClass(Ljava/lang/Class;)Z;

Kindly find an attached stack trace I am getting while running my test case.
openEJB_exception_isproxy.txt 

Any idea about the error will be appreciated.
Thanks in advance.
Akshit Bhatia
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoSuchMethodError: javassist.util.proxy.ProxyFactory.isProxyClass(Ljava/lang/Class;)Z.

Romain Manni-Bucau
Hi Akshit,

OpenEJB 3.0 didn't have javassist and this mbean wrapper so I guess
you either have mixed versions or not use OpenEJB 3. Then the
exception simply means javassist is there is a conflicting version.

Side note: as OpenEJB 3 doesn't have javassist, OpenEJB 4.7 or 7.x
don't rely anymore on javassist at all.

Romain Manni-Bucau
@rmannibucau |  Blog | Github | LinkedIn | Tomitriber


2016-04-01 6:33 GMT+02:00 akshit <[hidden email]>:

> Hi,
> In my project I am testing a method of EJB using a JUnit class. So to obtain
> the reference and create a local environment I used openEJB 3.0. And for
> using it, I create a java class where I have set properties related to
> openEJB connection. I have also registered an aspect in aop.xml and have
> added the project, containing aop.xml, in the build path. Kindly find the
> stack trace below. Especially what is the meaning of error:
> NoSuchMethodError:  java.lang.NoSuchMethodError:
> javassist.util.proxy.ProxyFactory.isProxyClass(Ljava/lang/Class;)Z;
>
> Kindly find an attached stack trace I am getting while running my test case.
> openEJB_exception_isproxy.txt
> <http://tomee-openejb.979440.n4.nabble.com/file/n4678040/openEJB_exception_isproxy.txt>
>
> Any idea about the error will be appreciated.
> Thanks in advance.
> Akshit Bhatia
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/java-lang-NoSuchMethodError-javassist-util-proxy-ProxyFactory-isProxyClass-Ljava-lang-Class-Z-tp4678040.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoSuchMethodError: javassist.util.proxy.ProxyFactory.isProxyClass(Ljava/lang/Class;)Z.

akshit
Hi Romain,
I thank you for your previous reply.  As you previously stated that the exception means that there is a conflicting version of javassist, I have checked all the possibilities of different javassist version existing. As of now, there is only a single instance of javassist 3.15.0 GA and it is coming from openejb-core: 4.5.1. But still I am getting the same error. Please note that when I tried the execution after removing conflicting javassist, the project ran but only for two times. After that, the same exception is coming. And there is still only a single javassist version from openejb-core 4.5.1.
Hoping for a solution.

Thanks & Regards,
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoSuchMethodError: javassist.util.proxy.ProxyFactory.isProxyClass(Ljava/lang/Class;)Z.

Romain Manni-Bucau
if you use maven check the dependency tree and the classloader
hierrchy for tests.

Romain Manni-Bucau
@rmannibucau |  Blog | Github | LinkedIn | Tomitriber


2016-04-05 12:35 GMT+02:00 akshit <[hidden email]>:

> Hi Romain,
> I thank you for your previous reply.  As you previously stated that the
> exception means that there is a conflicting version of javassist, I have
> checked all the possibilities of different javassist version existing. As of
> now, there is only a single instance of javassist 3.15.0 GA and it is coming
> from openejb-core: 4.5.1. But still I am getting the same error. Please note
> that when I tried the execution after removing conflicting javassist, the
> project ran but only for two times. After that, the same exception is
> coming. And there is still only a single javassist version from openejb-core
> 4.5.1.
> Hoping for a solution.
>
> Thanks & Regards,
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/java-lang-NoSuchMethodError-javassist-util-proxy-ProxyFactory-isProxyClass-Ljava-lang-Class-Z-tp4678040p4678085.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoSuchMethodError: javassist.util.proxy.ProxyFactory.isProxyClass(Ljava/lang/Class;)Z.

akshit
Hi Romain,
As you have suggested, I checked maven dependency hierarchy using the command: 'mvn dependency:tree' and also have checked the pom Dependency Hierarchy in eclipse IDE. And I have found only javassist 3.15.0 GA version coming from openejb-core:4.5.1. Still I am facing the same error?
In your reply I could not understand the meaning of class loader hierarchy. How can i check it?
Any other suggestion will also be preferred..
Thanks & Regards,
Akshit Bhatia
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoSuchMethodError: javassist.util.proxy.ProxyFactory.isProxyClass(Ljava/lang/Class;)Z.

Romain Manni-Bucau
in your test do something like:

loader = Thread.currentThread().getContextClassLoader();
do {
System.out.println(loader);
loader = loader.getParent();
} while (loader != null);

It would allow to check if it is the normal tree or if you run in a
particular context which can be polluted by another javassist.

Also in the same method do:

System.out.println(ProxyFactory.class.getProtectionDomain().getCodeSource().getLocation())


Romain Manni-Bucau
@rmannibucau |  Blog | Github | LinkedIn | Tomitriber


2016-04-06 8:58 GMT+02:00 akshit <[hidden email]>:

> Hi Romain,
> As you have suggested, I checked maven dependency hierarchy using the
> command: 'mvn dependency:tree' and also have checked the pom Dependency
> Hierarchy in eclipse IDE. And I have found only javassist 3.15.0 GA version
> coming from openejb-core:4.5.1. Still I am facing the same error?
> In your reply I could not understand the meaning of class loader hierarchy.
> How can i check it?
> Any other suggestion will also be preferred..
> Thanks & Regards,
> Akshit Bhatia
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/java-lang-NoSuchMethodError-javassist-util-proxy-ProxyFactory-isProxyClass-Ljava-lang-Class-Z-tp4678040p4678090.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.