Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Jetty 7.0.1 + JNDI NameNotFoundException

Hello all,

I have a problem with JNDI in Jetty 7.0.1

I always get a javax.naming.NameNotFoundException; remaining name 'env/jms/flex/ActiveMqConnectionFactory' error

See below my web.xml and jetty-env.xml config files. I manually unpacked my war in the {JETTY_HOME}/webapps

I downloaded version 7.0.1.v20091125 from the eclipse website and start it with java -jar start.jar

These are my options in start.ini: OPTIONS=Server,jmx,jsp,plus,resources,webapp,websocket

Why do I get this error:

javax.naming.NameNotFoundException; remaining name 'env/jms/flex/ActiveMqConnectionFactory'
        at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:632)
        at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:663)
        at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:678)
        at org.eclipse.jetty.jndi.java.javaRootURLContext.lookup(javaRootURLContext.java:110)
        at javax.naming.InitialContext.lookup(Unknown Source)

All help is welcome!
regards,
Leon


web.xml:
<resource-ref>
        <description>Connection Factory</description>
        <res-ref-name>jms/flex/ActiveMqConnectionFactory</res-ref-name>
        <res-type>javax.jms.TopicConnectionFactory</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
    
    <resource-env-ref>
        <resource-env-ref-name>jms/stockQuoteTopic</resource-env-ref-name>
        <resource-env-ref-type>javax.jms.Topic</resource-env-ref-type>
    </resource-env-ref>

jetty-env (in my WEB-INF)
<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="wac" class="org.eclipse.jetty.webapp.WebAppContext">
   
     <Set name="configurationClasses">
      <Array type="java.lang.String">
        <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
        <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
        <Item>org.eclipse.jetty.plus.webapp.Configuration</Item>
        <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
        <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>
      </Array>
     </Set>


   
    <!-- ActiveMQ Connection Factory -->
    <New id="myFactory" class="org.eclipse.jetty.plus.jndi.Resource">
       <Arg>
          <Ref id="wac" />
       </Arg>
       <Arg>jms/flex/ActiveMqConnectionFactory</Arg>
       <Arg>
          <New class="org.apache.activemq.ActiveMQConnectionFactory">
             <Arg>tcp://localhost:61616</Arg>
          </New>
        </Arg>
    </New>
   
    <!-- ActiveMQ stock quote Topic-->
    <New id="stockQuoteTopic" class="org.eclipse.jetty.plus.jndi.Resource">
       <Arg><Ref id="wac"/></Arg>
       <Arg>jms/stockQuoteTopic</Arg>
       <Arg>
          <New class="org.apache.activemq.command.ActiveMQTopic">
             <Arg>stockQuoteTopic</Arg>
          </New>
       </Arg>
    </New>
</Configure>

Voeg je Hyves, Facebook en LinkedIn contacten toe aan Hotmail en Messenger

Back to the top