Skip to main content

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

Haipeng,

the config seems fine. Are you positive you're using the correct
version of the jetty maven plugin? I notice you don't have a <version>
element in the plugin declaration - do you have a <pluginManagement>
section elsewhere in the project that specifies the version? If not,
then please try specifying the latest version (8.1.1.v20120215). Also,
are you sure there aren't any other errors in the startup sequence?
Try doing "mvn -X jetty:run".

thanks
Jan

On 29 February 2012 10:40, haipeng du <haipengdu@xxxxxxxxx> wrote:
> 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.
>
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>


Back to the top