NoClassDefFoundError... [message #247056] |
Wed, 29 August 2007 05:08 |
Eclipse User |
|
|
|
Originally posted by: simon.ou.edu
Hi...
I hope that all is well.
I have a serial port code that works within a regular java application.
When I port the same code (mostly untoched) onto an RCP plugin
applicaiton, then I get the following error:
java.lang.NoClassDefFoundError: gnu/io/CommPortIdentifier
at com.saic.ngk.messaging.SerialComm.<init>(SerialComm.java:23)
at
com.saic.ngk.userInterface.TSmainGui.createPartControl(TSmai nGui.java:80)
.....
The libraries are obvioulsy correctly installed in the proper places for
the Java-only application to work correctly. It is a problem with the
plugin run-time enviornment, but I cannot figure this out.
I wonder if any one has had a similar issue where
java.lang.NoClassDefFoundError
comes along? How to solve this problem? Thanks.
Regards...
Miguel.
|
|
|
Re: NoClassDefFoundError... [message #247061 is a reply to message #247056] |
Wed, 29 August 2007 06:21 |
Eclipse User |
|
|
|
Originally posted by: jacek.pospychala.pl.ibm.com
Miguel,
Because of their OSGI nature, plugins have different approach to loading
classes. They look only in other plug-ins and not in jars.
You can package your jar in a plug-in (remember to keep it in folder,
don't jar it), if it's your jar you can repackage it's classes directly
into a plug-in. In fact, if the jar is repackaged into plug-in, it still
can work as a jar for normal Java applications, but works also for OSGI
apps.
There is more detail on this common issue:
http://wiki.eclipse.org/Pragmatic_Advice_on_PDE_Classpath
Adding 3rd party jar files:
http://wiki.eclipse.org/Plug-in_Development_Environment
miguel wrote:
> Hi...
>
> I hope that all is well.
>
> I have a serial port code that works within a regular java
> application. When I port the same code (mostly untoched) onto an RCP
> plugin applicaiton, then I get the following error:
>
> java.lang.NoClassDefFoundError: gnu/io/CommPortIdentifier
> at com.saic.ngk.messaging.SerialComm.<init>(SerialComm.java:23)
> at
> com.saic.ngk.userInterface.TSmainGui.createPartControl(TSmai nGui.java:80)
> ....
>
> The libraries are obvioulsy correctly installed in the proper places
> for the Java-only application to work correctly. It is a problem with
> the plugin run-time enviornment, but I cannot figure this out.
>
> I wonder if any one has had a similar issue where
>
> java.lang.NoClassDefFoundError
>
> comes along? How to solve this problem? Thanks.
>
> Regards...
>
> Miguel.
>
|
|
|
Re: NoClassDefFoundError... [message #247079 is a reply to message #247061] |
Wed, 29 August 2007 12:37 |
Eclipse User |
|
|
|
Originally posted by: simon.ou.edu
Hi Jacek...
I appreciate your help. This was exactly what was going on. The two
links that you provided point to the exact solution. Thanks again.
This problem + solution should be somewhere in the FAQ. Do you know if
they are? How could any one suggest and/or include this in the FAQ for
Eclipse? Thanks.
Regards...
Miguel.
Jacek Pospychala wrote:
> Miguel,
> Because of their OSGI nature, plugins have different approach to loading
> classes. They look only in other plug-ins and not in jars.
> You can package your jar in a plug-in (remember to keep it in folder,
> don't jar it), if it's your jar you can repackage it's classes directly
> into a plug-in. In fact, if the jar is repackaged into plug-in, it still
> can work as a jar for normal Java applications, but works also for OSGI
> apps.
>
> There is more detail on this common issue:
> http://wiki.eclipse.org/Pragmatic_Advice_on_PDE_Classpath
> Adding 3rd party jar files:
> http://wiki.eclipse.org/Plug-in_Development_Environment
>
|
|
|
Re: NoClassDefFoundError... [message #247084 is a reply to message #247079] |
Wed, 29 August 2007 13:47 |
Eclipse User |
|
|
|
Originally posted by: jacek.pospychala.pl.ibm.com
Miguel,
Indeed, I looked into main FAQ
(http://wiki.eclipse.org/index.php/The_Official_Eclipse_FAQs)
and RCP-FAQ (http://wiki.eclipse.org/index.php/RCP_FAQ)
but didn't found it.
Anyone (you too!) can add to Wiki, you'll only need to create your own
account, but this is just to keep your email.
miguel wrote:
> Hi Jacek...
>
> I appreciate your help. This was exactly what was going on. The two
> links that you provided point to the exact solution. Thanks again.
>
> This problem + solution should be somewhere in the FAQ. Do you know
> if they are? How could any one suggest and/or include this in the FAQ
> for Eclipse? Thanks.
>
> Regards...
>
> Miguel.
>
>
>
> Jacek Pospychala wrote:
>> Miguel,
>> Because of their OSGI nature, plugins have different approach to
>> loading classes. They look only in other plug-ins and not in jars.
>> You can package your jar in a plug-in (remember to keep it in folder,
>> don't jar it), if it's your jar you can repackage it's classes
>> directly into a plug-in. In fact, if the jar is repackaged into
>> plug-in, it still can work as a jar for normal Java applications, but
>> works also for OSGI apps.
>>
>> There is more detail on this common issue:
>> http://wiki.eclipse.org/Pragmatic_Advice_on_PDE_Classpath
>> Adding 3rd party jar files:
>> http://wiki.eclipse.org/Plug-in_Development_Environment
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03478 seconds