• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple Send, Receive (Messaging) Bean

 
A. S. Georgie
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

this part solved put if might'm bald as to ask you look down page for another error

I'm trying to run simple JMS (through JBoss MDB), with two stand alone application named, Sender and Receiver,
i'm compiling all smoothly but when i'm running Sending and Receiver i'm getting following error:

Exception in thread "main" java.lang.NoClassDefFoundError: Sender (wrong name: j
ms/mdbbean/Sender)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

and same for Receiver too, also ihave "jbossall-client.jar;jnp-client.jar;naming.jar;j2ee-1.4.jar;" in the classpath.


please i wanna know, do missing some'?

My appreciation to all ...
 
A. S. Georgie
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


removing this part from Sender and Receiver solved problem, but i get another error as:

------------ NamingException ------------

javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource f
ile: java.naming.factory.initial
 
Abhishek Upadhyay
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you paste a more of exception.
I dont kno about JBoss, but check:
IS Queue Name bind to the JNDI name you are providing.
Also, you might need other jars like
dhbcore.jar, fscontext.jar(or depending on Intial Context), jndi.jar, and providerutil.jar
Above jars are needed when sending message form a java program, which is not running in app. server.

 
vk jain
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please share the deployment descriptor you are using to deploy receiver.
 
A. S. Georgie
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhishek Upadhyay wrote:Can you paste a more of exception.
I dont kno about JBoss, but check:
IS Queue Name bind to the JNDI name you are providing.
Also, you might need other jars like
dhbcore.jar, fscontext.jar(or depending on Intial Context), jndi.jar, and providerutil.jar
Above jars are needed when sending message form a java program, which is not running in app. server.


Oh hi, yes, thank you, where this is part of JBoss running, and deploying, i think it's true, what do you think?

06:56:11,593 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic

06:56:11,593 INFO [testQueue] Bound to JNDI name: queue/testQueue
06:56:11,625 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.
0.0:8093
06:56:11,640 INFO [DLQ] Bound to JNDI name: queue/DLQ
06:56:11,656 INFO [JmsXA] Bound connection factory for resource adapter for Con
nectionManager 'jboss.jca:service=TxCM,name=JmsXA to JNDI name 'java:/JmsXA'
06:56:11,671 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/D
:/jboss-3.2.5/server/default/deploy/jmx-console.war/
06:56:11,859 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=file:/D
:/jboss-3.2.5/server/default/tmp/deploy/tmp37538web-console.war/
06:56:12,234 INFO [Server] JBoss (MX MicroKernel) [3.2.5 (build: CVSTag=JBoss_3
_2_5 date=200406251954)] Started in 4s:656ms
06:56:12,234 INFO [Tomcat5] Saw org.jboss.system.server.started notification, s
tarting connectors
06:56:12,250 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-808
0
06:56:12,296 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
06:56:12,296 INFO [JkMain] Jk running ID=0 time=0/15 config=null

06:57:22,140 INFO [EjbModule] Deploying MDBBean
06:57:22,203 WARN [JMSContainerInvoker] Could not find the queue destination-jn
di-name=queue/MyQueue
06:57:22,203 WARN [JMSContainerInvoker] destination not found: queue/MyQueue re
ason: javax.naming.NameNotFoundException: MyQueue not bound
06:57:22,203 WARN [JMSContainerInvoker] creating a new temporary destination: q
ueue/MyQueue
06:57:22,203 INFO [MyQueue] Bound to JNDI name: queue/MyQueue
06:57:22,234 INFO [EJBDeployer] Deployed: file:/D:/jboss-3.2.5/server/default/d
eploy/mbean.jar


and this is the screen when you run Send client:

------------ NamingException ------------

javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource f
ile: java.naming.factory.initial


javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource f
ile: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
45)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288
)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
a:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at Sender.main(Sender.java:26)
Press any key to continue . . .


i'll try other jars then reply, thanks
 
A. S. Georgie
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vk jain wrote:Can you please share the deployment descriptor you are using to deploy receiver.


hello, you bet, this is ejb-jar.xml




and this is jboss.xml:



and this is the Sender client i'm using:



thanksss
 
A. S. Georgie
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhishek Upadhyay wrote:
dhbcore.jar, fscontext.jar(or depending on Intial Context), jndi.jar, and providerutil.jar
Above jars are needed when sending message form a java program, which is not running in app. server.


about dhbcore.jar, jndi.jar, providerutil.jar, googled around unfortunately with no result, where can i find them?
 
A. S. Georgie
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhishek Upadhyay wrote:
Also, you might need other jars like
dhbcore.jar, fscontext.jar(or depending on Intial Context), jndi.jar, and providerutil.jar
Above jars are needed when sending message form a java program, which is not running in app. server.


amazing, very good, i mean, i just put these two jars (fscontext-0.jar, winstone-0.9.6.jar) and my error is now about jndi name like following:

------------ NamingException ------------

javax.naming.NameNotFoundException: Name QueueConnectionFactory not found


javax.naming.NameNotFoundException: Name QueueConnectionFactory not found
at winstone.jndi.WinstoneContext.lookup(WinstoneContext.java:159)
at winstone.jndi.WinstoneContext.lookup(WinstoneContext.java:199)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at Sender.main(Sender.java:18)
Press any key to continue . . .


again thank you ...
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Georgie,

A. S. Georgie wrote:

------------ NamingException ------------

javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource f
ile: java.naming.factory.initial



I think you get this because the Initial Context is not set up. You can set it up by adding a jndi.properties file in the classpath which would have entries like these:

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.namingrg.jnp.interfaces
java.naming.provider.url=localhost:1099


Have a look at the Source Code in Chapter2 JBoss EJB3 tutorial

 
A. S. Georgie
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishwanath Krishnamurthi wrote:
javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource f
ile: java.naming.factory.initial[/color]


Hi there,
but as you ssee adding the foregoing jars partly problem changed to this, lemme know your idea:

------------ NamingException ------------

javax.naming.NameNotFoundException: Name QueueConnectionFactory not found


javax.naming.NameNotFoundException: Name QueueConnectionFactory not found
at winstone.jndi.WinstoneContext.lookup(WinstoneContext.java:159)
at winstone.jndi.WinstoneContext.lookup(WinstoneContext.java:199)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at Sender.main(Sender.java:18)
Press any key to continue . . .


 
govinda bhagat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
 
govinda bhagat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,
i did start my jsp but not proper run. The requested resource () is not available.
what i do for proper running please inform me .

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic