Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Question on jar references

Hi Don,
You probably need to start jetty with a couple of options as documented here:
http://wiki.eclipse.org/Jetty/Reference/Start_Options
Hugues

On Wed, Jul 21, 2010 at 7:45 AM, Don Santillan <donzymeth@xxxxxxxxx> wrote:
> Hello,
>
> I'd like to know if the jars at JETTY_HOME/lib are available and can be
> referenced automatically from deployed wars?
>
> I asked this because I always get a NoClassDefFoundError such as this:
> 2010-07-21 22:37:19.287:WARN::FAILED
> WebAppContext@5b675e@5b675e/local-gateway,file:/tmp/Jetty_0_0_0_0_8080_local.gateway.war__local.gateway__1ojphj/webapp/,/usr/local/jetty/jetty-distribution-7.1.4.v20100610/webapps/local-gateway.war:
> java.lang.NoClassDefFoundError: org/eclipse/jetty/plus/jndi/Resource
> 2010-07-21 22:37:19.288:WARN::Error for /cargo-jetty-deployer/deploy
> java.lang.NoClassDefFoundError: org/eclipse/jetty/plus/jndi/Resource
>
> I looked into the JETTY_HOME/lib and found the class in
> jetty-plus-7.1.4.v20100610.jar but I still get the exception.
>
> Do I always need to include the dependent jars to my war app? Or there is a
> way to reference the libraries from JETTY_HOME/lib so that there is no need
> to have a duplicate of the jar in my war app?
>
> -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
>


Back to the top