Instantiation exception

Using Hermes with ObjectWeb JORAM

Instantiation exception

Postby philippe.laumay » Tue Oct 12, 2004 10:12 am

Hi everybody.

I am happy to create the first topic for the joram plug in :D !

I try to use the new Hermes release 1.7RC1 with Joram 4.1.0.
When I can create the ClassGroup for joram. but when i try to create a session, in the session preference I got an error when I select the ConnectionFactory org.objectweb.joram.client.jms.ConnectionFactory (using the Joram class group).
In hermes log :
2004-10-12 11:52:14,316 [AWT-EventQueue-0] DEBUG hermes.browser.dialog.PreferencesDialog - refocusing on null
2004-10-12 11:52:17,745 [AWT-EventQueue-0] DEBUG hermes.browser.dialog.PreferencesDialog - refocusing on
2004-10-12 11:52:23,263 [AWT-EventQueue-0] ERROR hermes.browser.dialog.ConnectionFactoryConfigPanel -
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java
:30)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)


Any Idea ?
Thanks,
Philippe Laumay

PS: nevertheless I successfully connect to the JNDI server of Joram using my Joram classgroup.
philippe.laumay
 
Posts: 4
Joined: Tue Oct 12, 2004 9:33 am
Location: Grenoble, France

Postby Colin » Tue Oct 12, 2004 11:44 am

Hi Philippe,

Thanks for joining :D

If you get an exception in the dialog, just hit "OK" or "Apply" anyway and try and browse.

I get the opposite, I can browse a JORAM queue but I cannot browse a Context.

Here are the relevant bits of my config XML to compare to yours

Classpath:

<classpathGroup id="JORAM">
<library noFactories="true" jar="C:\local\joram-4.1.0\ship\lib\JCup.jar"/>
<library noFactories="true" jar="C:\local\joram-4.1.0\ship\lib\ow_monolog.jar"/>
<library noFactories="true" jar="C:\local\joram-4.1.0\ship\lib\joram-mom.jar"/>
<library noFactories="true" jar="C:\local\joram-4.1.0\ship\lib\joram-client.jar"/>
<library noFactories="true" jar="C:\local\joram-4.1.0\ship\lib\joram-shared.jar"/>
<library noFactories="true" jar="C:\local\joram-4.1.0\ship\lib\jakarta-regexp-1.2.jar"/>
<library noFactories="true" jar="C:\local\joram-4.1.0\ship\lib\kxml.jar"/>
</classpathGroup>

JNDI:

<naming id="JORAM" classpathId="JORAM">
<properties>
<property name="port" value="16400"/>
<property name="initialContextFactory" value="fr.dyade.aaa.jndi2.client.NamingContextFactory"/>
<property name="host" value="localhost"/>
</properties>
</naming>


JMS:

<factory classpathId="JORAM">
<provider className="hermes.JNDIQueueConnectionFactory">
<properties>
<property name="binding" value="qcf"/>
<property name="host" value="localhost"/>
<property name="initialContextFactory" value="fr.dyade.aaa.jndi2.client.NamingContextFactory"/>
<property name="port" value="16400"/>
</properties>
</provider>
<connection>
<session reconnects="0" audit="false" transacted="true" id="JORAM"/>
</connection>
<destination domain="1" name="queue" useLocalRenderer="false">
<renderer className="hermes.renderers.DefaultMessageRenderer">
<properties>
<property name="toStringOnObjectMessage" value="false"/>
<property name="messageCache" value="100"/>
<property name="bytesIsString" value="false"/>
<property name="bytesIsObjectBufferSize" value="65536"/>
<property name="bytesIsObject" value="false"/>
</properties>
</renderer>
</destination>
<extension className="hermes.ext.joram.JoramAdminFactory">
<properties/>
</extension>
</factory>


When I try and browse a context I get the following - although I can browse a queue fine!

2004-10-12 12:37:01,640 [Hermes ThreadPool-2] ERROR hermes.browser.actions.AbstractActionImpl - in doAction(): null
java.lang.ExceptionInInitializerError
at fr.dyade.aaa.jndi2.client.NamingContextFactory.getInitialContext(NamingContextFactory.java:57)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at hermes.JNDIContextBean._getContext(JNDIContextBean.java:206)
at hermes.browser.components.ContextTreeModelFactory.create(ContextTreeModelFactory.java:53)
at hermes.browser.actions.BrowseContextAction.doAction(BrowseContextAction.java:112)
at hermes.browser.actions.AbstractActionImpl.run(AbstractActionImpl.java:94)
at hermes.impl.ThreadPool.run(ThreadPool.java:182)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassCastException
at org.objectweb.util.monolog.wrapper.log4j.MonologLoggerFactory.getLogger(MonologLoggerFactory.java:195)
at fr.dyade.aaa.util.Debug.getLogger(Debug.java:139)
at fr.dyade.aaa.jndi2.client.Trace.<clinit>(Trace.java:34)
... 11 more

Cheers,

Colin.
Colin
Site Admin
 
Posts: 835
Joined: Sun Sep 19, 2004 4:49 pm
Location: London, UK

Postby philippe.laumay » Tue Oct 12, 2004 1:47 pm

Hi Colin

here is my config XML :

ClassPath:
<classpathGroup id="JoramClassGroup">
<library noFactories="false" jar="/home/laumayp/joram-4.1.0/ship/lib/joram-client.jar" factories="org.objectweb.joram.client.jms.ConnectionFactory,org.objectweb.joram.client.jms.QueueConnectionFactory,org.objectweb.joram.client.jms.TopicConnectionFactory"/>
<library noFactories="true" jar="/home/laumayp/joram-4.1.0/ship/lib/joram-mom.jar"/>
<library noFactories="true" jar="/home/laumayp/joram-4.1.0/ship/lib/joram-shared.jar"/>
<library noFactories="true" jar="/home/laumayp/joram-4.1.0/ship/lib/ow_monolog.jar"/>
<library noFactories="true" jar="/home/laumayp/joram-4.1.0/ship/lib/JCup.jar"/>
<library noFactories="true" jar="/home/laumayp/joram-4.1.0/ship/lib/kxml.jar"/>
<library noFactories="true" jar="/home/laumayp/joram-4.1.0/ship/lib/jakarta-regexp-1.2.jar"/>
</classpathGroup>

JNDI:
<naming id="JoramJNDI" classpathId="JoramClassGroup">
<properties>
<property name="port" value="16400"/>
<property name="initialContextFactory" value="fr.dyade.aaa.jndi2.client.NamingContextFactory"/>
<property name="host" value="localhost"/>
</properties>
</naming>

JMS:
<factory classpathId="JoramClassGroup">
<provider className="hermes.JNDIQueueConnectionFactory">
<properties>
<property name="binding" value="testConnectionFactory"/>
<property name="host" value="localhost"/>
<property name="initialContextFactory" value="fr.dyade.aaa.jndi2.client.NamingContextFactory"/>
<property name="port" value="16400"/>
</properties>
</provider>
<connection password="root" username="root">
<session reconnects="0" audit="false" transacted="true" id="JoramTest"/>
</connection>
<destination domain="1" name="testQueue1" useLocalRenderer="false" shortName="testQueue1">
<renderer className="hermes.renderers.DefaultMessageRenderer">
<properties>
<property name="toStringOnObjectMessage" value="false"/>
<property name="messageCache" value="100"/>
<property name="bytesIsString" value="false"/>
<property name="bytesIsObjectBufferSize" value="65536"/>
<property name="bytesIsObject" value="false"/>
</properties>
</renderer>
</destination>
<extension className="hermes.ext.DefaultHermesAdminFactory">
<properties/>
</extension>
</factory>

With this config I can view the JNDI context but not browse the queue.

I found an hint in the hermes.log. The exception is :
...
2004-10-12 15:36:17,399 [Hermes ThreadPool-0] ERROR hermes.browser.actions.AbstractActionImpl - in doAction(): null
java.lang.ExceptionInInitializerError
at fr.dyade.aaa.jndi2.client.NamingContextFactory.getInitialContext(NamingContextFactory.java:57)
...
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassCastException
at org.objectweb.util.monolog.wrapper.log4j.MonologLoggerFactory.getLogger(MonologLoggerFactory.java:195)
at fr.dyade.aaa.util.Debug.getLogger(Debug.java:139)
...

It is really strange because it comes from the initialisation of NamingContextFactory of Joram :? !
I continue my investigation...
philippe.laumay
 
Posts: 4
Joined: Tue Oct 12, 2004 9:33 am
Location: Grenoble, France

Postby philippe.laumay » Tue Oct 12, 2004 2:11 pm

Good news ! :D

after a relaunch of Hermes, it seems to work correctly.

I let you know...
philippe.laumay
 
Posts: 4
Joined: Tue Oct 12, 2004 9:33 am
Location: Grenoble, France

Exception when trying to browse queue

Postby colomb » Mon Nov 08, 2004 10:27 pm

On a similar note I get this when I try to browse one of my Joram queues:
2004-11-08 16:10:24,413 [Hermes ThreadPool-0] DEBUG hermes.browser.actions.Queue
BrowseAction - browse stopped CSS-PriceMachine-Realtime-Response
2004-11-08 16:10:24,413 [Hermes ThreadPool-0] DEBUG hermes.browser.actions.Brows
erAction - closing my hermes id=Joram Session
2004-11-08 16:10:24,413 [Hermes ThreadPool-0] DEBUG hermes.browser.actions.Queue
BrowseAction - nmessages=0
2004-11-08 16:10:24,429 [Hermes ThreadPool-0] ERROR hermes.browser.actions.Abstr
actActionImpl - in doAction(): null
java.lang.NullPointerException
at javax.naming.InitialContext.getURLScheme(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at hermes.JNDIConnectionFactory.createConnection(JNDIConnectionFactory.java:69)
at hermes.impl.jms.ConnectionSharedManager.connect(ConnectionSharedManager.java:104)
at hermes.impl.jms.ConnectionSharedManager.getConnection(ConnectionSharedManager.java:173)
at hermes.impl.jms.ConnectionSharedManager.getObject(ConnectionSharedManager.java:199)
at hermes.impl.jms.ThreadLocalSessionManager.connect(ThreadLocalSessionManager.java:157)
at hermes.impl.jms.ThreadLocalSessionManager.getSession(ThreadLocalSessionManager.java:477)
at hermes.impl.jms.AbstractSessionManager.getDestination(AbstractSessionManager.java:419)
at hermes.impl.DefaultHermesImpl.getDestination(DefaultHermesImpl.java:293)
at hermes.browser.actions.QueueBrowseAction.createQueueBrowser(QueueBrowseAction.java:81)
at hermes.browser.actions.QueueBrowseAction.doBrowseAction(QueueBrowseAction.java:121)
at hermes.browser.actions.BrowserAction.doAction(BrowserAction.java:410)
at hermes.browser.actions.AbstractActionImpl.run(AbstractActionImpl.java
:94)
at hermes.impl.ThreadPool.run(ThreadPool.java:182)
at java.lang.Thread.run(Unknown Source)
2004-11-08 16:10:24,429 [Hermes ThreadPool-0] DEBUG hermes.impl.ThreadPool - tas
k browse Joram Session: CSS-PriceMachine-Realtime-Response stopped

Anyone have any ideas?
colomb
 
Posts: 2
Joined: Mon Nov 08, 2004 10:24 pm

Postby Colin » Tue Nov 09, 2004 9:56 am

Hi,

At a guess maybe you're missing some JNDI properties?

What have u set? Does the configuration you're using work OK in a standalone app?

Colin.
Colin
Site Admin
 
Posts: 835
Joined: Sun Sep 19, 2004 4:49 pm
Location: London, UK

Postby Colin » Tue Nov 09, 2004 10:04 am

I set:

port=16400
initialContextFactory=fr.dyade.aaa.jndi2.client.NamingContextFactory
host=localhost

Not sure if JORAM uses providerURL correctly as I had to add in these non-standard "port" and "host" properties to support it.

Could explain this:

at javax.naming.InitialContext.getURLScheme(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)

Colin.
Colin
Site Admin
 
Posts: 835
Joined: Sun Sep 19, 2004 4:49 pm
Location: London, UK

Postby colomb » Fri Nov 12, 2004 8:40 pm

those are the exact settings i have in the preferences under the connection factory settings. is there anything else i need to set?
colomb
 
Posts: 2
Joined: Mon Nov 08, 2004 10:24 pm

how to configure Hermes JMS with Joram.

Postby Tachker » Fri Apr 01, 2005 12:37 pm

Hi,

I just make a how to configure Hermes JMS with Joram.
http://wiki.objectweb.org/joram/Wiki.jsp?page=Hermes

regards,
Nicolas.
Tachker
 
Posts: 1
Joined: Fri Apr 01, 2005 12:30 pm
Location: Grenoble, France


Return to ObjectWeb JORAM

Who is online

Users browsing this forum: No registered users and 1 guest