Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > J2ee example in Jboss

Reply
Thread Tools

J2ee example in Jboss

 
 
Flex
Guest
Posts: n/a
 
      12-15-2004
I'd like to run SimpleQueueReceiver and Sender () under Jboss.
I create a queue to add these lines in
default/deploy/jms/jbossmq-destinations-service.xml :

<mbean
code="org.jboss.mq.server.jmx.Queue"
name="jboss.mq.destination:service=Queue,name=myQu eue"> <depends
optional-attribute-name="DestinationManager">jboss.mq:service=Destina tionManager</depends>
</mbean>

after that I run the server , but when I run :
java SimpleQueueReceiver
I receive:
myQueue Exception in thread "main" java.lang.NoClassDefFoundError:
javax/jms/JMSException

What can I do ?

--
Ciao Flex
[X contattarmi togli NONSPAMM RE dall'indirizzo Per SPAM scrivete a: /dev/null]
________________________________________________
Chi sa ascoltare non solo simpatico a tutti ,
ma prima o poi finisce con l'imparare qualcosa

 
Reply With Quote
 
 
 
 
kjc
Guest
Posts: n/a
 
      12-15-2004
The J2EE classes can't be found in your classpath

use
java -cp "Classpath To All required classes" SimpleQueueReceiver

Flex wrote:
> I'd like to run SimpleQueueReceiver and Sender () under Jboss.
> I create a queue to add these lines in
> default/deploy/jms/jbossmq-destinations-service.xml :
>
> <mbean
> code="org.jboss.mq.server.jmx.Queue"
> name="jboss.mq.destination:service=Queue,name=myQu eue"> <depends
> optional-attribute-name="DestinationManager">jboss.mq:service=Destina tionManager</depends>
> </mbean>
>
> after that I run the server , but when I run :
> java SimpleQueueReceiver
> I receive:
> myQueue Exception in thread "main" java.lang.NoClassDefFoundError:
> javax/jms/JMSException
>
> What can I do ?
>


 
Reply With Quote
 
 
 
 
Flex
Guest
Posts: n/a
 
      12-15-2004
Il Wed, 15 Dec 2004 16:22:00 +0000, kjc ha scritto:

> The J2EE classes can't be found in your classpath
>
> use
> java -cp "Classpath To All required classes" SimpleQueueReceiver
>

Good , Now the error changes , now when I digit java
SimpleQueueReceiver myQueue the error is :

Queue name is myQueue
JNDI API lookup failed: javax.naming.NoInitialContextException:
Need to specify class name in environment or system property, or as an
applet parameter, or in an application resource file:
java.naming.factory.initial

It's strange because , like I wrote
> Flex wrote:
>> I create a queue to add these lines in
>> default/deploy/jms/jbossmq-destinations-service.xml :
>>
>> <mbean
>> code="org.jboss.mq.server.jmx.Queue"
>> name="jboss.mq.destination:service=Queue,name=myQu eue"> <depends
>> optional-attribute-name="DestinationManager">jboss.mq:service=Destina tionManager</depends>
>> </mbean>
>>


--
Ciao Flex

 
Reply With Quote
 
Sudsy
Guest
Posts: n/a
 
      12-15-2004
> Good , Now the error changes , now when I digit java
> SimpleQueueReceiver myQueue the error is :
>
> Queue name is myQueue
> JNDI API lookup failed: javax.naming.NoInitialContextException:
> Need to specify class name in environment or system property, or as an
> applet parameter, or in an application resource file:
> java.naming.factory.initial
>
> It's strange because , like I wrote


So now you have to look at the source for SimpleQueueReceiver and
find out where it obtains the initial naming context. Dig through
the archives at <http://groups.google.com> for some examples. Use
"+initialcontext +jboss" as your search string.
 
Reply With Quote
 
Flex
Guest
Posts: n/a
 
      12-15-2004
Il Wed, 15 Dec 2004 13:24:19 -0500, Sudsy ha scritto:

>> Good , Now the error changes , now when I digit java
>> SimpleQueueReceiver myQueue the error is :
>>
>> Queue name is myQueue
>> JNDI API lookup failed: javax.naming.NoInitialContextException:
>> Need to specify class name in environment or system property, or as an
>> applet parameter, or in an application resource file:
>> java.naming.factory.initial
>>
>> It's strange because , like I wrote

>
> So now you have to look at the source for SimpleQueueReceiver and
> find out where it obtains the initial naming context. Dig through
> the archives at <http://groups.google.com> for some examples. Use
> "+initialcontext +jboss" as your search string.


I try to find a solution there , but I find only questions not reply, I
read Jboss documentation , and ,perhaps , I had to add something into
jndi.properties, but I don't' know other.
I'm very confusing, if I read again I became more confuse, I need to sleep,
I hope to solve this problem tomorrow

--
Ciao Flex
[X contattarmi togli NONSPAMM RE dall'indirizzo Per SPAM scrivete a: /dev/null]
________________________________________________
Chi sa ascoltare non solo simpatico a tutti ,
ma prima o poi finisce con l'imparare qualcosa

 
Reply With Quote
 
Sudsy
Guest
Posts: n/a
 
      12-16-2004
<snip>
> I try to find a solution there , but I find only questions not reply, I
> read Jboss documentation , and ,perhaps , I had to add something into
> jndi.properties, but I don't' know other.
> I'm very confusing, if I read again I became more confuse, I need to sleep,
> I hope to solve this problem tomorrow


Sorry, but I'm all out of spoons!
If you weren't able to find solutions with the search string I so
generously provided then you weren't trying very hard.
I'll purchase a spoon as soon as you remit project funding via
PayPal...
 
Reply With Quote
 
Flex
Guest
Posts: n/a
 
      12-16-2004
Il Wed, 15 Dec 2004 21:34:54 -0500, Sudsy ha scritto:

> <CUT>
> I'll purchase a spoon as soon as you remit project funding via
> PayPal...


It isn't a good idea
This is the code that it generates exception :

try {
queueConnectionFactory = (QueueConnectionFactory)
jndiContext.lookup("QueueConnectionFactory");
queue = (Queue) jndiContext.lookup(queueName);
} catch (NamingException e) {
System.out.println("JNDI API lookup failed: " +
e.toString());
System.exit(1);
}

It's strange , I digit to run :
java -cp
..:/opt/jboss/client/jboss-j2ee.jar:/opt/jboss/client/jbossall-client.jar
SimpleQueueSender MyQueue 3

And this is the error message :
Queue name is MyQueue
JNDI API lookup failed: javax.naming.NoInitialContextException: Need to
specify class name in environment or system property, or as an applet
parameter, or in an application resource file:
java.naming.factory.initial

does Someone have got an idea ?

--
Ciao Flex

 
Reply With Quote
 
Sudsy
Guest
Posts: n/a
 
      12-16-2004
Flex wrote:
> does Someone have got an idea ?


You're in luck! Someone just returned one of my spoons. Here you go:

Properties p = new Properties();
props.setProperty( "java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory" );
props.setProperty( "java.naming.provider.url", "127.0.0.1:1099" );
props.setProperty( "java.naming.factory.url.pkgs", "org.jboss.naming" );
Context ctx = new InitialContext( props );
queueConnectionFactory = (QueueConnectionFactory)
ctx.lookup( "QueueConnectionFactory" );
...

Feeling better now?
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      12-16-2004
On Thu, 16 Dec 2004 12:53:19 -0500, Sudsy wrote:

> You're in luck! Someone just returned one of my spoons.


The Spoonman?

> Feeling better now?


<grumbles>
I prefer strawberry topping.
</grumbles>



--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Application in JBoss Portal on Liferay JBoss LprzemekL Java 0 04-10-2008 12:03 PM
Eclipse/Lomboz/JBoss: Cannot Start JBoss (Debug) Server from Eclipse Using Lomboz Plugin Jubz Java 0 05-30-2006 10:24 PM
jboss 4.0.3 jboss portal 2.2.1 han Java 0 05-08-2006 10:35 AM
JBoss packages deployable to Sun J2EE? Raydog Java 1 11-12-2004 11:38 PM
How do you do multi user apps on Jboss/J2EE? Ryan Boder Java 0 09-03-2003 03:57 AM



Advertisments