agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] NoClassDefFoundError?
2+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] NoClassDefFoundError?
@ 2008-04-14 19:31  
  0 siblings, 1 reply; 2+ messages in thread

From:  @ 2008-04-14 19:31 UTC (permalink / raw)

I have a test1.jar, which has one class and a few methods. All of the methods work except the ones that call a static method or initialize a class that is located in another jar, test2. jar, which is included in test1. jar, I get the following error message from PostgreSQL:

  ERROR:  java.lang.NoClassDefFoundError: com/example/TestClass

  ********** Error **********

  ERROR: java.lang.NoClassDefFoundError: com/example/TestClass
  SQL state: XX000

test1.jar looks like this on the inside:

  a..    com/example/Main.class (includes "import com.example.TestClass")
  b..   test2.jar

test2.jar looks this on the inside:
  a..    com/example/TestClass

Any ideas as to why that may be happening?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20080414/405b7633/attachment.html;



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* [Pljava-dev] NoClassDefFoundError?
@ 2008-04-15 09:06  
  parent: 
  0 siblings, 0 replies; 2+ messages in thread

From:  @ 2008-04-15 09:06 UTC (permalink / raw)


Hi, Manuel,

"Manuel" <manueldao at hotmail.com> wrote:

> test1.jar looks like this on the inside:
> 
>   a..    com/example/Main.class (includes "import com.example.TestClass")
>   b..   test2.jar
> 
> test2.jar looks this on the inside:
>   a..    com/example/TestClass
> 
> Any ideas as to why that may be happening?  

You cannot simply include one jar in another, the classloader won't
figure this out.

Either you merge the 2 jar files into a single one, or add the second
jar file to your classpath separately, or use your own classloader.

See http://www-128.ibm.com/developerworks/java/library/j-onejar/ for a
poor guy who had to solve the same problem some time ago.


Regards,
Markus

-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2008-04-15 09:06 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-04-14 19:31 [Pljava-dev] NoClassDefFoundError? 
2008-04-15 09:06 ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox