I have inherited an application written in java for the RCP framework (eclipse).
The code comes complete with build system (maven), and pom files, and everything seems to build.
The final application exe cannot run however. I get a popup with an error, and then a link to a log file describing numerous error. Problem is, I'm very new at RCP, I pretty much don't know what OSGI is, and I don't understand all of maven. So I have difficulty trying to figure out what the problem is, or even where to begin.
The log file starts out like this:
!ENTRY org.eclipse.osgi 4 0 2013-10-14 13:38:14.717 !MESSAGE
Application error !STACK 1 java.lang.RuntimeException: Application
"com.company.prod.app.rcp.application" could not be found in the
registry. The applications available are:
org.eclipse.equinox.app.error,
org.eclipse.help.base.infocenterApplication,
org.eclipse.help.base.helpApplication,
org.eclipse.help.base.indexTool. at
org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:242)
at
org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at
org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at
org.eclipse.equinox.launcher.Main.run(Main.java:1311)
!ENTRY org.eclipse.osgi 2 0 2013-10-14 13:38:14.751 !MESSAGE One or
more bundles are not resolved because the following root constraints
are not resolved: !SUBENTRY 1 org.eclipse.osgi 2 0 2013-10-14
13:38:14.751 !MESSAGE Bundle
update@plugins/com.company.prod.app.data_2.0.5-SNAPSHOT.jar was not
resolved. !SUBENTRY 2 com.company.prod.app.data 2 0 2013-10-14
13:38:14.751 !MESSAGE Missing imported package microsoft.sql_0.0.0.
!ENTRY org.eclipse.osgi 2 0 2013-10-14 13:38:14.778 !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:
It then goes on to list each and every package in the application, listed as version 0.0.0. I'm assuming that version number has something to do with the problem, since they all of course don't have version 0.0.0.
Searching through all pom.xml files will not list a single dependency as version 0.0.0.
I don't understand where the microsoft.sql_0.0.0 imported package that is mentioned as the "root" cause comes from. I know that the code uses microsoft.sqlserver. It is imported in one java file, like this:
import com.microsoft.sqlserver.jdbc.SQLServerException;
And the package containing that import statement has microsoft.sqlserver listed as a dependency, like this:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc</artifactId>
<version>4.0</version>
</dependency>
Also, there is a "bundle" (?) somewhere that exports it, like this:
<Export-Package>
org.hsqldb.*,
com.microsoft.sqlserver.*
</Export-Package>
So, to me it seems to be exported, and imported correctly. But I don't understand maven that good (or is it an osgi or rcp error? not even sure).
Also. I have sqlserver.sqljdbc in my maven repository, at:
.m2\repository\com\microsoft\sqlserver\sqljdbc\4.0
Any hints at how to try and solve this will be appreciated.