Best unofficial Apache Server developers community |
|
I'm a OSGI newbie looking for some help.
I've been asked to create a simple REST bundle which invokes one of our databases to obtain information. I have the RESTLET components working but can't seem to resolve the JDBC connection issue which states the Oracle driver can not be found. I've tried all the options of creating a bundle for the driver, adding the jar file to the Apache Felix configuration but nothing seems to work. INFO: Starting the internal HTTP server on port 8182
Requesting a connection for Remedy DB from VenueDataDaoImpl.
Aug 19, 2011 5:15:46 PM org.restlet.resource.UniformResource doCatch
WARNING: Exception or error caught in resource
remedy.bundle.internal.VenueDataDAOSysException: oracle.jdbc.driver.OracleDriver not found by remedy.bundle [18]
at remedy.bundle.dao.impl.VenueDataDaoImpl.getDataSource(VenueDataDaoImpl.java:40)
at remedy.bundle.dao.impl.VenueDataDaoImpl.getVenuesByRetailer(VenueDataDaoImpl.java:83)
at remedy.bundle.internal.StoreResource.toHtml(StoreResource.java:40)
I've tried several different options mentioned in various blogs but nothing seems to work. I really could use some help if anyone knows how to resolve this issue. My environment is as follows: Apache Felix 3.2.2 Oracle 10.2.0.4 with the following POM representing my bundle. <build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>generate-resources</id>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<instructions>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Activator>remedy.bundle.internal.Activator</Bundle-Activator>
<Export-Package>remedy.bundle</Export-Package>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>2.0.4</version>
</dependency>
</dependencies>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Code which fails follows: Connection conn;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url = "jdbc:oracle:thin:@//sfrhsxxxxx.xxx.com:1521/prodxx.xxx.com";
conn = DriverManager.getConnection(url, "user", "password");
}
catch (ClassNotFoundException ex) {
throw new VenueDataDAOSysException(ex.getMessage());
} catch (IllegalAccessException ex) {
throw new VenueDataDAOSysException(ex.getMessage());
} catch (InstantiationException ex) {
throw new VenueDataDAOSysException(ex.getMessage());
} catch (SQLException ex) {
throw new VenueDataDAOSysException(ex.getMessage());
}
return conn;
}
Everything in terms of the REST processing is working, I just can't seem to resolve the class loading of the Oracle driver failure.Yea, I'm probably doing something dumb so I could really use some help. Thanks, Jeff
|