Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Re: help on activemq - jndi on jetty 7.1.4

Don,

It seems you don't have the right jetty jars on the classpath.
If you're running standalone, you should edit the start.ini
file and change the OPTIONS setting to include "plus". You
can see what jars the various options put onto the classpath
with: java -jar start.jar --list-options

If you're not using jetty as standalone but are doing something
embedded instead, then look at the various aggregate jars and
choose the ones that are suitable for you, eg jetty-all-x.jar
(pretty much everything as the name suggests) or at
least jetty-plus-x.jar in combination with the others. Here's
the link to the aggregates:
http://repo1.maven.org/maven2/org/eclipse/jetty/aggregate/

Jan

On 22/07/10 02:13, Don Santillan wrote:
I think I was able to remove references to org.mortbay.* classes and I'm
getting a different exception now:
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
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)

Any idea?

-don

Don Santillan wrote:
Hi Jesse,

I'm new to Jetty. I hope you don't mind me asking silly questions but
how can I put a logger call to the xml? Can you show me an example?

-don

Jesse McConnell wrote:
sounds like your still not configured correctly or something..

grep through all your files and look for org.mortbay references, it
could be you have a lingering reference to org.mortbay

if memory serves you shouldn't have to do anothing special to trigger
the jetty-env.xml, you could always insert a logger call in that
jetty-env.xml file to validate its called picked up..

cheers,
jesse

--
jesse mcconnell
jesse.mcconnell@xxxxxxxxx



On Wed, Jul 21, 2010 at 06:20, Don Santillan <donzymeth@xxxxxxxxx>
wrote:

Hello Jan,

I tried it but still I am getting a NameNotFoundException:
javax.naming.NameNotFoundException; remaining name
'jms/connectionFactory'
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:634)
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:665)
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:665)
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:680)
at
org.mortbay.naming.java.javaRootURLContext.lookup(javaRootURLContext.java:112)

at javax.naming.InitialContext.lookup(InitialContext.java:392)

from the line:
javax.naming.InitialContext context = new
javax.naming.InitialContext();
connectionFactory =
(ConnectionFactory)context.lookup("java:comp/env/jms/connectionFactory");


I also tried:
javax.naming.InitialContext context = new
javax.naming.InitialContext();
connectionFactory =
(ConnectionFactory)context.lookup("jms/connectionFactory");

but the exception was the same with only 2
org.mortbay.naming.NamingContext.lookup() calls instead of 4.

Is there something that I need to configure in the server in order to
reference jetty-env.xml?

I also noticed from the exception stack trace that it is still using
org.mortbay.* and not org.eclipse.*. Is that normal?


-don



Jan Bartel wrote:
Don,

A WEB-INF/jetty-env.xml file:

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd";>

<Configure class="org.eclipse.jetty.webapp.WebAppContext">

<New id="connectionFactory"
class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>jms/connectionFactory</Arg>
<Arg>
<New class="org.apache.activemq.ActiveMQConnectionFactory">
<!-- <Arg>vm://portfolioBroker</Arg> -->
<Arg>tcp://localhost:61616</Arg>
</New>
</Arg>
</New>

<New id="stocksQueue" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>jms/stocksQueue</Arg>
<Arg>
<New class="org.apache.activemq.command.ActiveMQQueue">
<Arg>Consumer.Node1.VirtualTopic.STOCKS</Arg>
</New>
</Arg>
</New>

</Configure>


A WEB-INF/web.xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
version="2.5">

<resource-ref>
<res-ref-name>jms/connectionFactory</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>

<message-destination-ref>


<message-destination-ref-name>jms/stocksQueue</message-destination-ref-name>

<message-destination-type>javax.jms.Queue</message-destination-type>
<message-destination-usage>Consumes</message-destination-usage>
</message-destination-ref>

</web-app>


Jan
On 21/07/10 16:21, Don Santillan wrote:
Hello,

Anybody?

-don

Don Santillan wrote:
Hello,

I am having problems making activemq 5.3.2 in jetty 7.1.4 to work
through jndi. I already followed a bunch of examples from the site
(and mailing lists) but I guess most of them are out of date.

Can anybody please make an actually working example that would only
prove that looking up from a context really gets a connection?

Thanks in advance!
-don
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users

--
Jan Bartel, Webtide LLC | janb@xxxxxxxxxxx | http://www.webtide.com


Back to the top