Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Strange exception in JMS application...

843830Aug 26 2009 — edited Aug 27 2009
Hi everybody! This is my first post here, so I hope it's the right place to post it.

I have an application (not written by me) that uses JMS publish/subscribe architecture in a like-tree structure to publish new messages and notify new messages to consumers on various levels of the tree-like structure.
The strange thing is that in particular circumstances (i.e. a consumer subscribing to a node with more than 3 sublevels or if a message has to be propagated to nodes that aren't last-level node (leaf-node)) the program gives me one or more exception that I can't fully understand.

All the exception are the same, apart from the "Thread-" number (growing by one at every exception) and "GeneratedConstructorAccessor" number and the last row where it refers to the code of my program.
An example exception template is:
Exception in thread "Thread-15" java.lang.IllegalAccessError: class sun.reflect.GeneratedConstructorAccessor2 cannot access its superclass sun.reflect.ConstructorAccessorImpl
 	at sun.misc.Unsafe.defineClass(Native Method)
	at sun.reflect.ClassDefiner.defineClass(Unknown Source)
	at sun.reflect.MethodAccessorGenerator$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.reflect.MethodAccessorGenerator.generate(Unknown Source)
	at sun.reflect.MethodAccessorGenerator.generateConstructor(Unknown Source)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at java.lang.Class.newInstance0(Unknown Source)
	at java.lang.Class.newInstance(Unknown Source)
	at com.sun.messaging.AdministeredObject.initOwnedProperties(AdministeredObject.java:775)
	at com.sun.messaging.AdministeredObject.<init>(AdministeredObject.java:183)
	at com.sun.messaging.BasicConnectionFactory.<init>(BasicConnectionFactory.java:72)
	at com.sun.messaging.ConnectionFactory.<init>(ConnectionFactory.java:34)
	at services.broker.Env.getConnectionFactory(Env.java:65)
	at services.broker.BrokerImpl$5.run(BrokerImpl.java:422)
The second-last row number also refers to my program but it's always the same row number, that points to the method getConnectionFactory() that gives access to an existing ConnectionFactory. Code for this method is:
	public ConnectionFactory getConnectionFactory(Context CTX, String CF_JNDI_NAME, String PROVIDER_URL)
	{
		ConnectionFactory conn = new ConnectionFactory();     // this is the row that causes the exception

        try
        {
        	conn.setProperty(ConnectionConfiguration.imqAddressList, PROVIDER_URL);
        	conn = (ConnectionFactory) CTX.lookup(CF_JNDI_NAME);
        }
		catch(Exception e)
		{
			System.out.println(e.toString());
			e.printStackTrace();
			System.exit(1);
		}

		return conn;
	}
I've searched all over internet for this kind of exception, without success. Maybe I'm missing something, but I don't know what. I've tried using/writing other applications in JMS and they all work without problem.

Sorry if I made some mistake writing in english.
Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2009
Added on Aug 26 2009
2 comments
1,459 views