[EMAIL PROTECTED] wrote:
Hi Stephan,

I already read many times this example, however it appeared more clearer this
time: I used the regcomp of the SDK: I used the one of the ure and it is still
better: I only have a problem of classpath to solve now. regcomp tells me that
css.lang.XMain is not found, however the ridl.jar file is added to the
classpath.

That problem is quite tricky. With some debug code in jurt/com/sun/star/comp/loader/RegistrationClassFinder.java, to find out what class loader chain is used exactly to load the component's org.stareditor.comp.MyMain class, the output

 [EMAIL PROTECTED]
  file:/export/home/sb93797/source/ure.m130/UNOTest/stareditor.uno.jar

 [EMAIL PROTECTED]
  file:/opt/openoffice.org/ure/share/java/java_uno.jar
  file:/opt/openoffice.org/ure/share/java/juh.jar
  file:/opt/openoffice.org/ure/share/java/jurt.jar
  file:/opt/openoffice.org/ure/share/java/ridl.jar
  file:/export/home/sb93797/source/ure.m130/UNOTest/stareditor.uno.jar

 [EMAIL PROTECTED]
  file:/opt/openoffice.org/ure/share/java/unoloader.jar

 [EMAIL PROTECTED]
  file:/export/home/sb93797/source/ure.m130/UNOTest/
  file:/export/home/sb93797/source/ure.m130/UNOTest/

 [EMAIL PROTECTED]
  file:/usr/java/jre1.5.0_03/lib/ext/dnsns.jar
  file:/usr/java/jre1.5.0_03/lib/ext/sunpkcs11.jar
  file:/usr/java/jre1.5.0_03/lib/ext/sunjce_provider.jar
  file:/usr/java/jre1.5.0_03/lib/ext/localedata.jar

 null

reveals that the class is already loaded by the AppClassLoader (not through a JAR, but directly from the file system hierarchy), which is too deep to know ridl.jar. Thus, the workaround should be to compile the class files to some other place than "-d .", so that regcomp won't find them by mistake via the AppClassLoader. (If you fix that, you will find out that regcomp still does not succeed, this time because the MyMain class is not public...)

What this also shows is that the -classpath argument to regcomp is effectively ignored, and that regcomp starts the JVM with an AppClassLoader that looks into the current directory. You can file me an issue for that.

-Stephan

Thank you for your help
Cedric


Selon Stephan Bergmann <[EMAIL PROTECTED]>:


[EMAIL PROTECTED] wrote:

Hi everybody,

I'm trying to create a hello world application based on the URE. However, I

get

an error when using regcomp:
error (CannotRegisterImplementationException):
ImplementationRegistration::registerImplementation() - The service
com.sun.star.loader.Java2 cannot be instantiated

Do you know what may be wrong ? My component is available on my website:
http://cedric.bosdonnat.free.fr/media/UNOTest.tar.gz

Thank you for your help,
Cedric

In the CVS, see ure/source/uretest/Makefile.pln for an example of
regcomp'ing a JAR:

  $(URE_HOME)/bin/regcomp -register \
    -br $(URE_HOME)/share/misc/types.rdb \
    -br $(URE_HOME)/share/misc/services.rdb -r $@ \
    -c file://$(PWD)/out.pln/javatest.uno.jar

Hope that helps,
-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to