Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] error to configure jndi with jetty-maven-plugin

Hi,
I just use jetty-maven-plugin ( version 8.1...). I think I have the right configuration to create jndi datasource. But I got error: Nothing to bind for name javax.sql.DataSource/default.
I searched internet and try many ways. But I am not lucky to solve this problem. Could some people help on this?
( I use jetty 6 before and there is no any problems after following documents to set up jndi ).
Thanks a lot.
Here is my plugin configuration in pom.xml:

<plugin>

<groupId>org.mortbay.jetty</groupId>

<artifactId>jetty-maven-plugin</artifactId>

<scanintervalseconds>10</scanintervalseconds>

<stopKey>stop</stopKey>

<stopPort>9078</stopPort>

<webAppConfig>

<contextPath>/myApp</contextPath>

<jettyEnvXml>${basedir}/src/main/jetty/jetty-env.xml</jettyEnvXml>

</webAppConfig>

<connectors>

<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">

<port>9079</port>

<maxIdleTime>60000</maxIdleTime>

</connector>

</connectors>

</configuration>

</plugin>

Here is my jetty-env.xml:

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


 <New id="datasource" class="org.eclipse.jetty.plus.jndi.Resource">

       

        <Arg>jdbc/appDataSource</Arg>

        <Arg>

                <New class="org.apache.commons.dbcp.BasicDataSource">

                        <Set name="driverClassName">oracle.jdbc.driver.OracleDriver</Set>

                        <Set name="url">jdbc:oracle:thin:@myoracle.com:1673:sid</Set>

                        <Set name="username">user</Set>

                        <Set name="password">password</Set>

                </New>

        </Arg>

</New> 


        

</Configure>


and here is my web.xml for resource-ref:



<resource-ref>

<description>DB Connection</description>

<res-ref-name>jdbc/appDataSource</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

<res-auth>Container</res-auth>

</resource-ref>   


Thanks a lot.


Back to the top