2016-03-21 32 views
0

Jetty, Oracle'a bağlanamıyor. Benim dalgakıran conf olarakOracle 11g bağlantı sorunuyla Jetty 9

Ben

<New id="demoRestLegacyDS" class="org.eclipse.jetty.plus.jndi.Resource"> 
<Arg></Arg> 
<Arg>jdbc/demoRestLegacyDB</Arg> 
<Arg> 
    <New class="oracle.jdbc.pool.OracleDataSource"> 
     <Set name="Url">jdbc:oracle:thin:@localhost:1521/MySchema</Set> 
     <Set name="User">TEST</Set> 
     <Set name="Password">TEST</Set> 
    </New> 
</Arg> 
</New> 

var Ve ben mvn temiz yüklemek dalgakıran ile çalıştırdığınızda ben

<dependency> 
     <groupId>com.oracle</groupId> 
     <artifactId>ojdbc14</artifactId> 
     <version>10.2.0.4.0</version> 
     <scope>provided</scope> 
    </dependency> 

Ancak maven bağımlılıkları kavanoz ekledi: çalıştırmak -Djetty.port = 8888

java.lang.ClassNotFoundException: oracle.jdbc.pool.OracleConnectionPoolDataSource in file:/C:/workspace/rest-api/src/main/resources/config/jetty9.xml 

cevap

0

pluggin maven iskelesine bağımlılık ekleyerek sorunu çözüldü

  <plugin> 
      <groupId>org.eclipse.jetty</groupId> 
      <artifactId>jetty-maven-plugin</artifactId> 
      <version>${jetty.maven.plugin.version}</version> 
      <configuration> 
       <jettyXml>${project.basedir}/src/main/resources/config/jetty9.xml</jettyXml> 
       <!-- ,${project.basedir}/src/main/resources/config/jetty-ssl.xml, ${project.basedir}/src/main/resources/config/jetty-https.xml --> 
       <stopKey>STOP</stopKey> 
       <stopPort>9999</stopPort> 
       <stopWait>5</stopWait> 
       <scanIntervalSeconds>5</scanIntervalSeconds> 
       <scanTargets> 
        <scanTarget>${project.basedir}/src/main</scanTarget> 
        <scanTarget>${project.basedir}/src/test</scanTarget> 
       </scanTargets> 
       <contextXml>${project.basedir}/src/test/resources/jetty-context.xml</contextXml> 
       <webAppConfig> 
        <contextPath>/${project.artifactId}</contextPath> 
       </webAppConfig> 
      </configuration> 
      <dependencies> 
       <dependency> 
        <groupId>mysql</groupId> 
        <artifactId>mysql-connector-java</artifactId> 
        <version>5.1.27</version> 
       </dependency> 
       <dependency> 
        <groupId>com.oracle</groupId> 
        <artifactId>ojdbc14</artifactId> 
        <version>10.2.0.4.0</version> 
       </dependency> 
      </dependencies> 
     </plugin>