Using jbossall-client jar in a Hibernate environment

hi,

While working on a web app which included a Hibernate module,  I had to write a JMX client that communicates with another server instence.

After writing the client (using JBoss's RMIAdaptor), I wanted to test it, so I started adding JBoss dependencies to my project's pom.xml. At about the the 5th one, I stopped and reverted to the one jar that is supposed to rule them all: jbossclient-all.jar. While running the test, however, I got:

java.lang.NoSuchMethodError: org.hibernate.cfg.ExtendedMappings.getReflectionManager()Lorg/hibernate/reflection/ReflectionManager;

Indeed, the above jar contained some Hibernate classes (Hibernate classes? in a client jar? wtf?) - which were probably the reason for the graceful(not) behavior. My question: has anyone tackled this issue before? has anyone written jboss-specific JMX code and had to resolve the dependency issues?

 

cheers,

 

Comments

I have JMX code that runs inside JBoss to monitor the EhCache statistics and it is also viewable by JConsole. If that is of any interest to you I can send you the code.

thanks,

running inside jboss isn't a problem, neither is the code itself,

it's the tests' classpath that I'm trying to figure out. So far, I've managed running with these dependencies(artifacts under org.jboss):
1. jnp-client
2. concurrent
3. jboss-jmx
4. jboss-common
5. jmx-adaptor-plugin
6. jboss
7. jboss-serialization
8. jboss-remoting
9. jbosssx
10. jboss-transaction.
Instead of these, I'd much rather use a single client jar...

cheers,

I doubt that you will find a single jar that does it all. Take a look at the folowing ANT task =, used for JMX communication:
http://docs.huihoo.com/javadoc/jboss/3.2.7/varia/org/jboss/ant/package-s...

They claim (a claim that has to be verified ...) only 4 JARS are needed:
jbossjmx-ant.jar
jboss-j2ee.jar
jboss-common-client.jar
sun jnet.jar

Give it a try using a simple ant file, or I can do it for you but only later today ...

thanks,

doesn't work... the jars are missing jboss security, remoting, transactions, interceptors...
I believe I found the reason to the error - we're using different version of Hibernate in the project classpath from the one used by jboss 4.2.3...
This has no effect in runtime(since all these dependencies are marked under "provided" scope), but is be a problem in development/testing, where version mismatch occurs. Generally, I think there shouldn't be a problem using the jbossall-client.jar, if the Hibernate versions matched...

cheers,