Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Where to put external JDBC driver within RAP
Where to put external JDBC driver within RAP [message #483013] Sat, 29 August 2009 09:20 Go to next message
Kay Chee Cheung is currently offline Kay Chee CheungFriend
Messages: 8
Registered: July 2009
Junior Member
Hi,
I am new to RAP. I tried to use JDBC connection in RAP application. I
put the JDBC jar files under Project Java Build Path, which works for normal
Eclipse project. But when I run the RAP application, I get a Class Not Found
message for my JDBC driver class.
My driver must be invisible to the web server being started. Where
else should I put the external JDBC jar ? Any help would be much
appreciated.

Kay Chee Cheung
Re: Where to put external JDBC driver within RAP [message #483096 is a reply to message #483013] Mon, 31 August 2009 06:50 Go to previous messageGo to next message
bjoern is currently offline bjoernFriend
Messages: 19
Registered: July 2009
Junior Member
Hi Kay,
what you face is not a RAP specific problem but rather an OSGi
classloading issue. If you use libraries in OSGi that load classes
dynamically (e.g. via Class#forName()), you have to deploy the library
as an OSGi bundle. This sounds more complicated than it is.

Simply use the new-wizard "Plug-in from Existing JAR Archives". Use the
"Add external..." button to point to your JDBC driver jar. On the next
page give a plug-in name and meta-info for your plug-in. I prefer not to
unzip the contents, but that is not important.

The wizard generates a plug-in which you can start together with your
app. When your package-imports are correct or you add the
library-plug-in to your required bundles, the driver class should be found.

Regards,
Björn

Eclipse Corner schrieb:
> Hi,
> I am new to RAP. I tried to use JDBC connection in RAP application.
> I put the JDBC jar files under Project Java Build Path, which works for
> normal Eclipse project. But when I run the RAP application, I get a
> Class Not Found message for my JDBC driver class.
> My driver must be invisible to the web server being started. Where
> else should I put the external JDBC jar ? Any help would be much
> appreciated.
>
> Kay Chee Cheung
Re: Where to put external JDBC driver within RAP [message #483398 is a reply to message #483096] Tue, 01 September 2009 13:17 Go to previous messageGo to next message
Kay Chee Cheung is currently offline Kay Chee CheungFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Björn ,
Thanks very much for your very valuable answer.
I created Plug-in project using the wizard "Plug-in from Existing JAR
Archives" as suggested.
I found that I need to add the plug-in in two places to make it work.
1. Add it under "Required Plug-in" in MANIFEST.MF or under
"Imported Packages" in MANIFEST.MF, and two
2. Add it as Bundle in the "Run configuration"
If I do only one of the above, then it would not work. I think this is
what you said implicitly in your answer as well.

Thanks very much for your great help! I could not find it anywhere
else.

Regards
Kay Chee


"Björn Fischer" <bjoern@bjoernfischer.de> wrote in message
news:h7frsd$id3$1@build.eclipse.org...
> Hi Kay,
> what you face is not a RAP specific problem but rather an OSGi
> classloading issue. If you use libraries in OSGi that load classes
> dynamically (e.g. via Class#forName()), you have to deploy the library
> as an OSGi bundle. This sounds more complicated than it is.
>
> Simply use the new-wizard "Plug-in from Existing JAR Archives". Use the
> "Add external..." button to point to your JDBC driver jar. On the next
> page give a plug-in name and meta-info for your plug-in. I prefer not to
> unzip the contents, but that is not important.
>
> The wizard generates a plug-in which you can start together with your
> app. When your package-imports are correct or you add the
> library-plug-in to your required bundles, the driver class should be
> found.
>
> Regards,
> Björn
>
> Eclipse Corner schrieb:
>> Hi,
>> I am new to RAP. I tried to use JDBC connection in RAP application.
>> I put the JDBC jar files under Project Java Build Path, which works for
>> normal Eclipse project. But when I run the RAP application, I get a
>> Class Not Found message for my JDBC driver class.
>> My driver must be invisible to the web server being started. Where
>> else should I put the external JDBC jar ? Any help would be much
>> appreciated.
>>
>> Kay Chee Cheung
Re: Where to put external JDBC driver within RAP [message #677431 is a reply to message #483013] Wed, 08 June 2011 13:49 Go to previous messageGo to next message
Hromada  is currently offline Hromada Friend
Messages: 2
Registered: June 2011
Junior Member
Hi, i am having similar problem, and when i will create plugin from jdbc driver and attach it to imported packages i just got following error.. I am pretty new in RAP so i am pretty much confused Smile can anyone help?

sgi> 2011-06-08 15:49:12.519:INFO:org.mortbay.log:Logging to STDERRorg.mortbay.log via org.mortbay.log.Slf4jLog
2011-06-08 15:49:12.572:INFO::jetty-6.1.x
2011-06-08 15:49:12.613:INFO::Started SelectChannelConnector@0.0.0.0:40951
!SESSION 2011-06-08 15:49:11.644 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=cs_CZ
Command-line arguments: -dev file:/home/jakub.hromadka/RAP_Workspace/.metadata/.plugins/org.eclipse.pde.core/Application/dev.properties -os linux -ws gtk -arch x86 -console -consolelog

!ENTRY Application 4 0 2011-06-08 15:49:13.310
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "Application_1.0.0.qualifier [40]" could not be resolved. Reason: Missing Constraint: Import-Package: org.postgresql; version="0.0.0"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1327)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1311)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1130)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.osgi 4 0 2011-06-08 15:49:13.313
!MESSAGE Bundle initial@reference:file:../RAP_Workspace/Application/ was not resolved.

!ENTRY org.eclipse.osgi 2 0 2011-06-08 15:49:13.334
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-06-08 15:49:13.334
!MESSAGE Bundle initial@reference:file:../RAP_Workspace/Application/ was not resolved.
!SUBENTRY 2 Application 2 0 2011-06-08 15:49:13.334
!MESSAGE Missing imported package org.postgresql_0.0.0.

!ENTRY org.eclipse.osgi 2 0 2011-06-08 15:49:13.337
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-06-08 15:49:13.337
!MESSAGE Bundle Application_1.0.0.qualifier [40] was not resolved.
!SUBENTRY 2 Application 2 0 2011-06-08 15:49:13.337
!MESSAGE Missing imported package org.postgresql_0.0.0.
Re: Where to put external JDBC driver within RAP [message #677436 is a reply to message #677431] Wed, 08 June 2011 14:27 Go to previous message
Hromada  is currently offline Hromada Friend
Messages: 2
Registered: June 2011
Junior Member
Ok my mistake sorry for spam, forgot to add bundle to run configuration Smile Now it runs perfectly. Thanks for this topic
Previous Topic:cheatsheets have problems when running from web application archive
Next Topic:Writing custom widgets is hell on earth
Goto Forum:
  


Current Time: Fri Apr 26 15:17:53 GMT 2024

Powered by FUDForum. Page generated in 0.04018 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top