-
1. Re: Which jars do I need in the Classpath?
jonlee Aug 14, 2003 6:16 PM (in response to programmer)Most times, all you will need is the jbossall-client.jar. Many of the other classes are separate bundlings of the classes that already appear in jbossall-client.jar. In your instance, I would drop the other JARs you have there as they are already contained in jbossall-client.jar.
On occassions, you may need additional JARs depending on local issues. You have such an instance here. You will need to include log4j.jar - it is also in the client directory of the distribution. -
2. Re: Which jars do I need in the Classpath?
programmer Aug 18, 2003 7:26 AM (in response to programmer)Hi Jonlee,
Thanks for the reply.
Something's still wrong though.
After I added log4j.jar, I got two more class not found exceptions and I fixed those by adding
lib\jboss-system.jar (for ServiceMBeanSupport class) and
lib\jboss-remorting.jar (for ClientInterceptor class).
Question: Was this right? Are there files in the client folder in which the above classes can be found?
But now I have started getting this error:
FATAL [main] (ClientServiceMBeanSupport.java:76) - Could not set up mbean server or mbeans in client
javax.management.ReflectionException: The MBean class could not be loaded by the default loader repository
at com.sun.jdmk.MBeanInstantiatorImpl.findClassWithDefaultLoaderRepository(MBeanInstantiator
.java:64)
.
.
.
at BeanClient.main(BeanClient.java:21)
javax.naming.CommunicationException [Root exception is java.io.InvalidObjectException: Problem setti
ng up mbean server or mbeans in client: javax.management.ReflectionException: The MBean class could
not be loaded by the default loader repository]
I have no idea what that means and how to solve it.
At this point my entire classpath looks like this:
.
C:\j2sdkee1.4\lib\j2ee.jar
E:\webMethods\Developer4\lib\client.jar
E:\Tomcat 4.1\common\lib\mysql-connector-java-3.1.0-alpha-bin.jar
E:\Tomcat 4.1\common\lib\servlet.jar
E:\oracle\ora92\jdbc\lib\ojdbc14.jar
E:\Program Files\Altova\xmlspy\XMLSpyInterface.jar
E:\jboss-4.0.0DR2\client\jboss-j2ee.jar
E:\jboss-4.0.0DR2\client\jboss-all-client.jar
E:\jboss-4.0.0DR2\client\jnp-client.jar
E:\jboss-4.0.0DR2\client\log4j.jar
E:\jboss-4.0.0DR2\client\jboss-system-client.jar
E:\jboss-4.0.0DR2\lib\jboss-system.jar
E:\jboss-4.0.0DR2\lib\jboss-remoting.jar
Thanks in advance. -
3. Re: Which jars do I need in the Classpath?
jonlee Aug 18, 2003 7:48 AM (in response to programmer)I'd check your naming - I think it should be jbossall-client.jar, not jboss-all-client.jar. I think this is the reason you are having the class problems because the primary library is actually not being loaded as it is not included in the classpath. Drop all your JBoss classes (jboss-j2ee.jar classes are actually in jbossall-client.jar) and add just jbossall-client.jar (unless 4.0.x has changed from 3.2.x and has really named the class jboss-all-client.jar) and the log4j.jar. See how that goes after this.
-
4. Re: Which jars do I need in the Classpath?
programmer Aug 18, 2003 8:16 AM (in response to programmer)It is named jboss-all-client.jar.
I did as you said retaining only two jboss jars, jboss-all-client and log4j.
I started getting
NoClassDefFoundError: org/jboss/system/ServiceMBeanSupport
So I added
E:\jboss-4.0.0DR2\lib\jboss-system.jar
after which I got the error
java.lang.NoClassDefFoundError: Lorg/jboss/remoting/ClientInterceptor;
So I added
E:\jboss-4.0.0DR2\lib\jboss-remoting.jar
which caused the error
FATAL [main] (ClientServiceMBeanSupport.java:76) - Could not set up mbean server or mbeans in client
Here's a part of the source:
public class BeanClient
{
public static void main(String[] args)
{
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, "localhost:1099");
try
{
// get an initial context
InitialContext jndiContext = new InitialContext(props);
System.out.println("Got context");
// get a reference to the bean
Object ref = jndiContext.lookup("Adder");
I get the error at the last line. It gets the context and prints out the "Got context" message. -
5. Re: Which jars do I need in the Classpath?
jonlee Aug 18, 2003 8:46 AM (in response to programmer)It seems like you have managed to somehow invoke an AOP-like operation since for some reason it is expecting local MBeans and remoting - this is not the behaviour expected and one you would not get from 3.2.x. I'm not that familiar with these new features since JBoss 4.0 is still a Developer Release.
I have noticed you are missing a necessary initial property:
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
e.g. props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
You might want to try that first to see if this solves part of the problem and gets your client working like a standard Java class. Otherwise you are going to need to get help from someone working with 4.0.x. -
6. Re: Which jars do I need in the Classpath?
programmer Aug 18, 2003 12:26 PM (in response to programmer)Something about release 4.0 is different.
I uninstalled it and installed 3.2.2RC2.
I then put only those jar files that you recommended in the classpath.
My program ran without a problem!