Bug 133180 - rmic -classpath argument not parsed correctly
rmic -classpath argument not parsed correctly
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Archit Shah
:
Depends On:
Blocks: 172174
  Show dependency treegraph
 
Reported: 2004-09-22 04:16 EDT by Gary Benson
Modified: 2007-11-30 17:10 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-11-10 11:57:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch for grmic (19.55 KB, patch)
2005-06-09 15:15 EDT, Archit Shah
no flags Details | Diff

  None (edit)
Description Gary Benson 2004-09-22 04:16:30 EDT
Description of problem:
rmic fails build one of the examples whilst building log4j.  Ant
invokes it with a -classpath argument, but not all of the directories
in this argument are added to the classpath so rmic is unable to build
the source class.

Version-Release number of selected component (if applicable):
libgcj-3.4.1-7

Additional info:
     [rmic] RMI Compiling 1 class to
/home/gary/pkgs/log4j/jakarta-log4j-1.2.8/dist/classes
     [rmic] java.lang.ClassNotFoundException:
examples.NumberCruncherServer not found in
[file:/usr/share/java/ant.jar, file:/usr/share/java/ant-launcher.jar,
file:/usr/lib64/jvm/java/lib/tools.jar, file:/usr/share/java/jaf.jar,
file:/usr/share/java/javamail/mailapi.jar,
file:/usr/share/java/libgcj-3.4.1.jar, file:./, core:/]
     [rmic]    at java.net.URLClassLoader.findClass(java.lang.String)
(/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at
gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String)
(/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at java.lang.ClassLoader.loadClass(java.lang.String,
boolean) (/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader)
(/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at java.lang.Class.forName(java.lang.String, boolean,
java.lang.ClassLoader) (/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at gnu.java.rmi.rmic.RMIC.findClass()
(/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at
gnu.java.rmi.rmic.RMIC.analyzeClass(java.lang.String)
(/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at
gnu.java.rmi.rmic.RMIC.processClass(java.lang.String)
(/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at gnu.java.rmi.rmic.RMIC.run()
(/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at sun.rmi.rmic.Main.compile(java.lang.String[])
(Unknown Source)
     [rmic]    at _Jv_CallAnyMethodA(java.lang.Object,
java.lang.Class, _Jv_Method, boolean, boolean, java.lang.Class[],
jvalue, jvalue, boolean) (/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at _Jv_CallAnyMethodA(java.lang.Object,
java.lang.Class, _Jv_Method, boolean, java.lang.Class[],
java.lang.Object[]) (/usr/lib64/libgcj.so.5.0.0)
     [rmic]    at org.apache.tools.ant.taskdefs.rmic.SunRmic.execute()
(/usr/lib64/lib-org-apache-tools-ant-1.6.1.so)
     [rmic]    at org.apache.tools.ant.taskdefs.Rmic.execute()
(/usr/lib64/lib-org-apache-tools-ant-1.6.1.so)
     [rmic]    at org.apache.tools.ant.UnknownElement.execute()
(/usr/lib64/lib-org-apache-tools-ant-1.6.1.so)
     [rmic]    at org.apache.tools.ant.Task.perform()
(/usr/lib64/lib-org-apache-tools-ant-1.6.1.so)
     [rmic]    at org.apache.tools.ant.Target.execute()
(/usr/lib64/lib-org-apache-tools-ant-1.6.1.so)
     [rmic]    at org.apache.tools.ant.Target.performTasks()
(/usr/lib64/lib-org-apache-tools-ant-1.6.1.so)
     [rmic]    at
org.apache.tools.ant.Project.executeTarget(java.lang.String)
(/usr/lib64/lib-org-apache-tools-ant-1.6.1.so)
     [rmic]    at
org.apache.tools.ant.Project.executeTargets(java.util.Vector)
(/usr/lib64/lib-org-apache-tools-ant-1.6.1.so)
     [rmic]    at
org.apache.tools.ant.Main.runBuild(java.lang.ClassLoader)
(/usr/lib64/lib-org-apache-tools-ant-1.6.1.so)
     [rmic]    at
org.apache.tools.ant.Main.startAnt(java.lang.String[],
java.util.Properties, java.lang.ClassLoader)
(/usr/lib64/lib-org-apache-tools-ant-1.6.1.so)
     [rmic]    at
org.apache.tools.ant.launch.Launcher.run(java.lang.String[])
(/usr/lib64/lib-org-apache-tools-ant-launch-1.6.1.so)
     [rmic]    at
org.apache.tools.ant.launch.Launcher.main(java.lang.String[])
(/usr/lib64/lib-org-apache-tools-ant-launch-1.6.1.so)
Comment 1 Andrew Overholt 2005-03-11 11:30:45 EST
I'm having a similar issue trying to build lucene (with 4.0.0-0.32):

     [rmic] RMI Compiling 1 class to
/notnfs/overholt/rpmbuild/BUILD/lucene-1.4.3/build/classes/java
     [rmic] java.lang.ClassNotFoundException:
org.apache.lucene.search.RemoteSearchable not found in
gnu.gcj.runtime.SystemClassLoader{urls=[],
parent=gnu.gcj.runtime.VMClassLoader{urls=[file:/usr/share/java-ext/gnu-crypto-sasl-jdk1.4.jar],
parent=null}}
     [rmic]    at java.net.URLClassLoader.findClass(java.lang.String)
(/usr/lib/libgcj.so.6.0.0)
     [rmic]    at java.lang.ClassLoader.loadClass(java.lang.String,
boolean) (/usr/lib/libgcj.so.6.0.0)
     [rmic]    at java.lang.Class.forName(java.lang.String, boolean,
java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
     [rmic]    at gnu.java.rmi.rmic.RMIC.findClass()
(/usr/lib/libgcj.so.6.0.0)
     [rmic]    at
gnu.java.rmi.rmic.RMIC.analyzeClass(java.lang.String)
(/usr/lib/libgcj.so.6.0.0)
     [rmic]    at
gnu.java.rmi.rmic.RMIC.processClass(java.lang.String)
(/usr/lib/libgcj.so.6.0.0)
     [rmic]    at gnu.java.rmi.rmic.RMIC.run() (/usr/lib/libgcj.so.6.0.0)
     [rmic]    at sun.rmi.rmic.Main.compile(java.lang.String[])
(Unknown Source)
     [rmic]    at java.lang.reflect.Method.invoke(java.lang.Object,
java.lang.Object[]) (/usr/lib/libgcj.so.6.0.0)
     [rmic]    at org.apache.tools.ant.taskdefs.rmic.SunRmic.execute()
(Unknown Source)
     [rmic]    at org.apache.tools.ant.taskdefs.Rmic.execute()
(Unknown Source)
     [rmic]    at org.apache.tools.ant.UnknownElement.execute()
(Unknown Source)
     [rmic]    at org.apache.tools.ant.Task.perform() (Unknown Source)
     [rmic]    at org.apache.tools.ant.Target.execute() (Unknown Source)
     [rmic]    at org.apache.tools.ant.Target.performTasks() (Unknown
Source)
     [rmic]    at
org.apache.tools.ant.Project.executeTarget(java.lang.String) (Unknown
Source)
     [rmic]    at
org.apache.tools.ant.Project.executeTargets(java.util.Vector) (Unknown
Source)
     [rmic]    at
org.apache.tools.ant.Main.runBuild(java.lang.ClassLoader) (Unknown Source)
     [rmic]    at
org.apache.tools.ant.Main.startAnt(java.lang.String[],
java.util.Properties, java.lang.ClassLoader) (Unknown Source)
     [rmic]    at
org.apache.tools.ant.launch.Launcher.run(java.lang.String[]) (Unknown
Source)
     [rmic]    at
org.apache.tools.ant.launch.Launcher.main(java.lang.String[]) (Unknown
Source)
     [rmic]    at gnu.java.lang.MainThread.call_main()
(/usr/lib/libgcj.so.6.0.0)
     [rmic]    at gnu.java.lang.MainThread.run()
(/usr/lib/libgcj.so.6.0.0)
Comment 2 Thomas Fitzsimmons 2005-03-11 11:42:52 EST
Can you figure out the actual rmic command that ant is running and try
running grmic directly?  That will tell us if it's a problem in grmic
itself or in the wrapper scripts.
Comment 3 Andrew Overholt 2005-03-18 10:40:26 EST
It looks like it might be a problem in grmic itself:

$ grmic -d /notnfs/overholt/rpmbuild/BUILD/lucene-1.4.3/build/classes/java
-classpath
/notnfs/overholt/rpmbuild/BUILD/lucene-1.4.3/build/classes/java:/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/junit.jar:/usr/lib/jvm/java/lib/tools.jar:/usr/share/java/jdtcore.jar:/usr/share/java/libgcj-4.0.0.jar:/notnfs/overholt/rpmbuild/BUILD/lucene-1.4.3
org.apache.lucene.search.RemoteSearchable
java.lang.ClassNotFoundException: org.apache.lucene.search.RemoteSearchable not
found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
parent=gnu.gcj.runtime.VMClassLoader{urls=[core:/], parent=null}}
   at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
   at java.lang.ClassLoader.loadClass(java.lang.String, boolean)
(/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.findClass() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.analyzeClass(java.lang.String)
(/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.processClass(java.lang.String)
(/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.run() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.main(java.lang.String[]) (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)

versus:

$ rmic -d /notnfs/overholt/rpmbuild/BUILD/lucene-1.4.3/build/classes/java
-classpath
/notnfs/overholt/rpmbuild/BUILD/lucene-1.4.3/build/classes/java:/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/junit.jar:/usr/lib/jvm/java/lib/tools.jar:/usr/share/java/jdtcore.jar:/usr/share/java/libgcj-4.0.0.jar:/notnfs/overholt/rpmbuild/BUILD/lucene-1.4.3
org.apache.lucene.search.RemoteSearchable
java.lang.ClassNotFoundException: org.apache.lucene.search.RemoteSearchable not
found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
parent=gnu.gcj.runtime.VMClassLoader{urls=[core:/], parent=null}}
   at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
   at java.lang.ClassLoader.loadClass(java.lang.String, boolean)
(/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.findClass() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.analyzeClass(java.lang.String)
(/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.processClass(java.lang.String)
(/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.run() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.main(java.lang.String[]) (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
Comment 4 Thomas Fitzsimmons 2005-04-13 13:36:52 EDT
We should probably replace grmic with GNU Classpath's implementation since it
seems to be the "way forward" for RMI (e.g. IIOP support).
Comment 5 Thomas Fitzsimmons 2005-04-15 16:44:34 EDT
The problem isn't with grmic's -classpath option.  It's more likely a dependency
problem.  grmic works on .class files; if the corresponding .java files haven't
been compiled yet it will fail with a ClassNotFoundException.

Gary, can you build log4j with -v -v -v on the ant compile line so we know how
rmic is being invoked?    Also, can you verify that the
examples.NumberCruncherServer .class file exists when rmic is invoked?

Rawhide rmic symlinks directly to grmic so wrapper script problems are now an
impossibility.
Comment 6 Andrew Overholt 2005-06-09 10:42:05 EDT
This what's being run in my case:

rmic -verbose -d \
/notnfs/overholt/pkgcvs/lucene/devel/lucene-1.4.3/build/classes/java -classpath \
/notnfs/overholt/pkgcvs/lucene/devel/lucene-1.4.3/build/classes/java:/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/antlr.jar:/usr/share/java/ant/ant-antlr.jar:/usr/share/java/bcel.jar:/usr/share/java/ant/ant-apache-bcel.jar:/usr/share/java/log4j.jar:/usr/share/java/ant/ant-apache-log4j.jar:/usr/share/java/oro.jar:/usr/share/java/ant/ant-apache-oro.jar:/usr/share/java/regexp.jar:/usr/share/java/ant/ant-apache-regexp.jar:/usr/share/java/xml-commons-resolver.jar:/usr/share/java/ant/ant-apache-resolver.jar:/usr/share/java/jakarta-commons-logging.jar:/usr/share/java/ant/ant-commons-logging.jar:/usr/share/java/javamail/mailapi-1.3.1.jar:/usr/share/java/javamail/providers-1.3.1.jar:/usr/share/java/jaf.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/ant/ant-jmf.jar:/usr/share/java/jsch.jar:/usr/share/java/ant/ant-jsch.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-nodeps.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/jaxp_transform_impl.jar:/usr/share/java/ant/ant-trax.jar:/usr/lib/jvm/java/lib/tools.jar
 \
org.apache.lucene.search.RemoteSearchable

which results in:

[Processing class org.apache.lucene.search.RemoteSearchable.class]
[analyze class org.apache.lucene.search.RemoteSearchable]
java.lang.ClassNotFoundException: org.apache.lucene.search.RemoteSearchable not
found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./,file:./],
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
   at java.lang.ClassLoader.loadClass(java.lang.String, boolean)
(/usr/lib/libgcj.so.6.0.0)
   at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.findClass() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.analyzeClass(java.lang.String)
(/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.processClass(java.lang.String)
(/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.run() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.rmi.rmic.RMIC.main(java.lang.String[]) (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)

Even if I add the location of RemoteSearchable.class to the classpath, it fails
(in the same way).  The class file is indeed present when I run this command.

One interesting thing to note:  the -classpath option to grmic is currently
ignored (at least that's what the output of grmic --help says).
Comment 7 Thomas Fitzsimmons 2005-06-09 10:51:27 EDT
What if you export CLASSPATH to the same value you're trying to pass in on the
command line?
Comment 8 Andrew Overholt 2005-06-09 10:58:39 EDT
(In reply to comment #7)
> What if you export CLASSPATH to the same value you're trying to pass in on the
> command line?

Attempting this:

echo $CLASSPATH
/notnfs/overholt/pkgcvs/lucene/devel/lucene-1.4.3/build/classes/java:/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/antlr.jar:/usr/share/java/ant/ant-antlr.jar:/usr/share/java/bcel.jar:/usr/share/java/ant/ant-apache-bcel.jar:/usr/share/java/log4j.jar:/usr/share/java/ant/ant-apache-log4j.jar:/usr/share/java/oro.jar:/usr/share/java/ant/ant-apache-oro.jar:/usr/share/java/regexp.jar:/usr/share/java/ant/ant-apache-regexp.jar:/usr/share/java/xml-commons-resolver.jar:/usr/share/java/ant/ant-apache-resolver.jar:/usr/share/java/jakarta-commons-logging.jar:/usr/share/java/ant/ant-commons-logging.jar:/usr/share/java/javamail/mailapi-1.3.1.jar:/usr/share/java/javamail/providers-1.3.1.jar:/usr/share/java/jaf.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/ant/ant-jmf.jar:/usr/share/java/jsch.jar:/usr/share/java/ant/ant-jsch.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-nodeps.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/jaxp_transform_impl.jar:/usr/share/java/ant/ant-trax.jar:/usr/lib/jvm/java/lib/tools.jar

and then trying:

rmic -d /notnfs/overholt/pkgcvs/lucene/devel/lucene-1.4.3/build/classes/java \
org.apache.lucene.search.RemoteSearchable

I get:

error:Method public abstract void
org.apache.lucene.search.Searchable.search(org.apache.lucene.search.Query,org.apache.lucene.search.Filter,org.apache.lucene.search.HitCollector)
throws java.io.IOException does not throw a java.rmi.RemoteException
error:Method public abstract void org.apache.lucene.search.Searchable.close()
throws java.io.IOException does not throw a java.rmi.RemoteException
error:Method public abstract int
org.apache.lucene.search.Searchable.docFreq(org.apache.lucene.index.Term) throws
java.io.IOException does not throw a java.rmi.RemoteException
error:Method public abstract int org.apache.lucene.search.Searchable.maxDoc()
throws java.io.IOException does not throw a java.rmi.RemoteException
error:Method public abstract org.apache.lucene.search.TopDocs
org.apache.lucene.search.Searchable.search(org.apache.lucene.search.Query,org.apache.lucene.search.Filter,int)
throws java.io.IOException does not throw a java.rmi.RemoteException
error:Method public abstract org.apache.lucene.document.Document
org.apache.lucene.search.Searchable.doc(int) throws java.io.IOException does not
throw a java.rmi.RemoteException
error:Method public abstract org.apache.lucene.search.Query
org.apache.lucene.search.Searchable.rewrite(org.apache.lucene.search.Query)
throws java.io.IOException does not throw a java.rmi.RemoteException
error:Method public abstract org.apache.lucene.search.Explanation
org.apache.lucene.search.Searchable.explain(org.apache.lucene.search.Query,int)
throws java.io.IOException does not throw a java.rmi.RemoteException
error:Method public abstract org.apache.lucene.search.TopFieldDocs
org.apache.lucene.search.Searchable.search(org.apache.lucene.search.Query,org.apache.lucene.search.Filter,int,org.apache.lucene.search.Sort)
throws java.io.IOException does not throw a java.rmi.RemoteException

Comment 9 Archit Shah 2005-06-09 15:15:14 EDT
Created attachment 115275 [details]
patch for grmic

This patch (against the head of gcc CVS though I don't think it should matter
much) adds proper handling of -classpath and -d. It also corrects some of the
handling of inheritance in the remote implementation and of exceptions declared
by remote methods. This patch is mostly a subset of the one I sent to the
classpath mailing list:
http://lists.gnu.org/archive/html/classpath/2005-06/msg00045.html
Comment 10 Andrew Overholt 2005-10-27 17:17:57 EDT
This can probably be closed now that we have a gcc with Archit's patch.  Gary?
Comment 11 Gary Benson 2005-10-28 04:45:07 EDT
I don't know.  I have a big list of workarounds that need testing to see if they
are still necessary, and this one is on it.  If you want to test it yourself
then see if carol, jotm and log4j build after the removal of their respective
*-bz133180.patch.
Comment 12 Archit Shah 2005-11-10 11:57:08 EST
log4j, lucene and carol have had their patches removed. JOTM still needs its
patch because of its use of javax.rmi.PortableRemoteObject which won't be
present until libgcj 4.1.
Comment 13 Gary Benson 2005-11-10 12:22:07 EST
jonathan-rmi ought to be providing javax.rmi.PortableRemoteObject

Note You need to log in before you can comment on or make changes to this bug.