2 Replies Latest reply: Feb 17, 2011 3:07 AM by prakash32 RSS

[Resolved] Failed to create session

Fabrice Oliveira Newbie
Java Plug-in 1.6.0_18
Utilisation de la version JRE 1.6.0_18-b07 Java HotSpot(TM) Client VM
Rpertoire d'accueil de l'utilisateur = C:\Documents and Settings\TT
----------------------------------------------------
c:   effacer la fentre de la console
f:   finaliser les objets de la file d'attente de finalisation
g:   librer la mmoire
h:   afficher ce message d'aide
l:   vider la liste des chargeurs de classes
m:   imprimer le relev d'utilisation de la mmoire
o:   dclencher la consignation
q:   masquer la console
r:   recharger la configuration des politiques
s:   vider les proprits systme et dploiement
t:   vider la liste des threads
v:   vider la pile des threads
x:   effacer le cache de chargeurs de classes
0-5: fixer le niveau de traage  <n>
----------------------------------------------------
DirCleaner : 20100903
DirCleaner : Nothing to do for this user
CreateDir : 20100730
CreateDir : Meeting directory C:\ColSolFO\Test_HornetQ--20100930-1130 OK
Applet AS
HornetQException[errorCode=0 message=Failed to create session]
at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:490)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1123)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:877)
at asblazeds.ASBlazeDS.init(ASBlazeDS.java:50)
at asblazeds.ASBlazeDS.<init>(ASBlazeDS.java:36)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
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 sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/jboss/netty/channel/socket/ClientSocketChannelFactory
at org.hornetq.core.remoting.impl.netty.NettyConnectorFactory.createConnector(NettyConnectorFactory.java:40)
at org.hornetq.core.client.impl.FailoverManagerImpl.getConnection(FailoverManagerImpl.java:942)
at org.hornetq.core.client.impl.FailoverManagerImpl.getConnectionWithRetry(FailoverManagerImpl.java:834)
at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:342)
... 19 more
Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.socket.ClientSocketChannelFactory
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 23 more
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 26 more
HornetQException[errorCode=0 message=Failed to create session]
at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:490)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1123)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:877)
at asblazeds.ASBlazeDS.init(ASBlazeDS.java:50)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/jboss/netty/channel/socket/ClientSocketChannelFactory
at org.hornetq.core.remoting.impl.netty.NettyConnectorFactory.createConnector(NettyConnectorFactory.java:40)
at org.hornetq.core.client.impl.FailoverManagerImpl.getConnection(FailoverManagerImpl.java:942)
at org.hornetq.core.client.impl.FailoverManagerImpl.getConnectionWithRetry(FailoverManagerImpl.java:834)
at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:342)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.socket.ClientSocketChannelFactory
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 9 more
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 12 more

Hi,

 

I try to use the code of HornetQ documentation (here : http://hornetq.sourceforge.net/docs/hornetq-2.1.2.Final/user-manual/en/html/using-core.html) but i have the following exception :

 

 

 

HornetQException[errorCode=0 message=Failed to create session]

 

 

 

 

at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:490)

at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1123)

at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:877)

at asblazeds.ASBlazeDS.init(ASBlazeDS.java:49)

at asblazeds.ASBlazeDS.<init>(ASBlazeDS.java:35)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

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 sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)

at java.awt.event.InvocationEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

Caused by: java.lang.NoClassDefFoundError: org/hornetq/core/server/HornetQComponent

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(Unknown Source)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.access$300(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)

at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at org.hornetq.core.remoting.impl.invm.InVMConnectorFactory.createConnector(InVMConnectorFactory.java:40)

at org.hornetq.core.client.impl.FailoverManagerImpl.getConnection(FailoverManagerImpl.java:942)

at org.hornetq.core.client.impl.FailoverManagerImpl.getConnectionWithRetry(FailoverManagerImpl.java:834)

at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:342)

... 19 more

Caused by: java.lang.ClassNotFoundException: org.hornetq.core.server.HornetQComponent

at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

... 40 more

Caused by: java.io.IOException: open HTTP connection failed:http://XXX.XX.XXX.XX/xxxxxxx/inclus/modules/asFlex/org/hornetq/core/server/HornetQComponent.class

at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)

at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)

at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

... 43 more

HornetQException[errorCode=0 message=Failed to create session]

at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:490)

at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1123)

at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:877)

at asblazeds.ASBlazeDS.init(ASBlazeDS.java:49)

at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.NoClassDefFoundError: org/hornetq/core/server/HornetQComponent

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(Unknown Source)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.access$300(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)

at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at org.hornetq.core.remoting.impl.invm.InVMConnectorFactory.createConnector(InVMConnectorFactory.java:40)

at org.hornetq.core.client.impl.FailoverManagerImpl.getConnection(FailoverManagerImpl.java:942)

at org.hornetq.core.client.impl.FailoverManagerImpl.getConnectionWithRetry(FailoverManagerImpl.java:834)

at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:342)

... 5 more

Caused by: java.lang.ClassNotFoundException: org.hornetq.core.server.HornetQComponent

at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

... 26 more

Caused by: java.io.IOException: open HTTP connection failed:http://XXX.XX.XXX.XX/xxxx/inclus/modules/asFlex/org/hornetq/core/server/HornetQComponent.class

at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)

at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)

at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

... 29 more

 

 

For your information :
- Server JBoss 6.0 with HornetQ 2.0
- Client using an applet
Can you help me?
I resolved the problem. Applet require package netty.jar on server. Nothing on the documentation about that...
  • 1. Re: Failed to create session
    Jeff Mesnil Master

    You should check your HornetQ configuration.

     

    From your stack trace, it appears you are using INVM connectors:

     

    ...

    at org.hornetq.core.remoting.impl.invm.InVMConnectorFactory.createConnector(InVMConnectorFactory.java:40)

    at org.hornetq.core.client.impl.FailoverManagerImpl.getConnection(FailoverManagerImpl.java:942)

     

    However, as their names suggest, they must be used only when the client and the HornetQ servers are in the same VM.

    It is not your case as your application runs in an applet and the server in JBoss AS.


    Instead, configure your client to use a netty connector (and configure a corresponding netty acceptor in the server configuration): http://hornetq.sourceforge.net/docs/hornetq-2.1.2.Final/user-manual/en/html/configuring-transports.html#d0e3087

     

    HornetQ ships with an applet example (in jms/applet) which shows you how to configure everything to send and receive JMS messages from an applet.

  • 2. Re: [Resolved] Failed to create session
    prakash32 Newbie

    I am  getting .....

    Failed to create Session..............

    How to resolve this ..

     

    HornetQException[errorCode=0 message=Failed to create session]

     

      at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:490)

              at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1123)

              at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:887)

              at com.manam.prakash.testClass.EmbeddedContainerExample.main(EmbeddedContainerExample.java:65)

     

    Caused by: java.lang.NoSuchMethodError: org.jboss.netty.util.internal.ConversionUtil.toString(I)Ljava/lang/String;

     

       at org.jboss.netty.channel.StaticChannelPipeline.<init>(StaticChannelPipeline.java:87)

              at org.hornetq.core.remoting.impl.netty.NettyConnector$1.getPipeline(NettyConnector.java:365)

              at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:219)

              at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:192)

              at org.hornetq.core.remoting.impl.netty.NettyConnector.createConnection(NettyConnector.java:447)

              at org.hornetq.core.client.impl.FailoverManagerImpl.getConnection(FailoverManagerImpl.java:953)

              at org.hornetq.core.client.impl.FailoverManagerImpl.getConnectionWithRetry(FailoverManagerImpl.java:834)

              at org.hornetq.core.client.impl.FailoverManagerImpl.createSession(FailoverManagerImpl.java:342)

              ... 3 more