Re: rmic/classpath issues

Peter Jones - JavaSoft East <[email protected]>
Newsgroups gmane.comp.java.sun.rmi
Message-ID <20050128181553.GE4642@east>
> I recently installed JDK 1.4.2-07 on my linux box. I've been trying
> to get a stub from my RMI server using rmic withouth any success.
>
> What I've got basically is a server class in a directory called
> 'bin' and some libraries it depends on, in a diferent directory
> called 'lib', both directories inside my application dir.
>
> What I had been doing in windoze is something like this:
>
> rmic -classpath "bin:lib/xxxx.jar:lib/xxxx.jar:..." -d bin Server
>
> This worked on win with no problems. However in linux I get a
> beatiful:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: while
> resolving class: Server
> [...]
> Caused by: java.lang.ClassNotFoundException:
> net.sf.hibernate.cfg.Configuration not found in
> [file:/usr/java/j2se/jre/lib/rt.jar, file:./, core:/]
> [...]
>
> Obviously rmic is not findind my jars. I've tried everything without any
> result.

How sure are you that you are using the rmic tool from Sun's JDK?

The Sun JDK's rmic does not load application classes into its VM with
class loaders[*]-- it uses an internal library to read and process
application class files, like javac does-- so that exception does not
make sense.  It would be helpful if you provided the complete stack
trace of the exception.

> I recently noticed however, from the output of 'rmic --help', that
> rmic is ignoring the -classpath option, which is weird enough.

I don't understand that statement-- the usage message for rmic tool
from Sun's JDK (1.4.2, Linux or otherwise) should not say anything
about ignoring the -classpath option; it should list it as supported:

...
  -classpath <path>      Specify where to find input class files
  -bootclasspath <path>  Override location of bootstrap class files
  -extdirs <path>        Override location of installed extensions
...

> This must be a linux-only issue :?  Any clues?

It seems to me that you must be executing some other rmic tool on this
Linux machine, not the one from the Sun JDK (1.4.2 or otherwise).

-- Peter

[*] at least not when none of the CORBA options, like -iiop or -idl,
are used

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.