incompatibility with classworlds 1.0

84 views
Skip to first unread message

kmarivoe

unread,
Jul 27, 2012, 4:25:14 AM7/27/12
to js...@googlegroups.com
I'm using jspf in my project, with maven using the following dependency:

    <dependency>
      <groupId>net.xeoh.plugins</groupId>
      <artifactId>jspf.core</artifactId>
      <version>1.0.3</version>
    </dependency>

jspf-core depends on classworld 1.0:

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>net.xeoh.plugins</groupId>
  <artifactId>jspf.core</artifactId>
  <version>1.0.3</version>
  <name>Java Simple Plugin Framework</name>
  <dependencies>
    <dependency>
      <groupId>classworlds</groupId>
      <artifactId>classworlds</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>org.net.jcores</groupId>
      <artifactId>jcores</artifactId>
      <version>0.9.1</version>
    </dependency>
  </dependencies>
</project>


However, jspf is incompatible with this version:

Caused by: java.lang.NoSuchMethodError: org.codehaus.classworlds.ClassWorld.newRealm(Ljava/lang/String;Ljava/lang/ClassLoader;)Lorg/codehaus/classworlds/ClassRealm;
        at net.xeoh.plugins.base.impl.classpath.ClassPathManager$1.run(ClassPathManager.java:109)
        at java.security.AccessController.doPrivileged(Native Method)
        at net.xeoh.plugins.base.impl.classpath.ClassPathManager.<init>(ClassPathManager.java:101)
        at net.xeoh.plugins.base.impl.PluginManagerImpl.<init>(PluginManagerImpl.java:105)
        at net.xeoh.plugins.base.impl.PluginManagerFactory.createPluginManager(PluginManagerFactory.java:114)
        at net.xeoh.plugins.base.impl.PluginManagerFactory.createPluginManager(PluginManagerFactory.java:67)

, and it contains its own version of these classes:

jar -tf jspf.core-1.0.3.jar
org/codehaus/classworlds/
org/codehaus/classworlds/uberjar/
org/codehaus/classworlds/uberjar/boot/
org/codehaus/classworlds/uberjar/protocol/
org/codehaus/classworlds/uberjar/protocol/jar/
org/codehaus/classworlds/ClassRealm.class
org/codehaus/classworlds/ClassWorld$1.class
org/codehaus/classworlds/ClassWorld.class
org/codehaus/classworlds/ClassWorldException.class
org/codehaus/classworlds/ConfigurationException.class
org/codehaus/classworlds/Configurator$1.class
org/codehaus/classworlds/Configurator$2.class
org/codehaus/classworlds/Configurator.class
org/codehaus/classworlds/DefaultClassRealm.class
org/codehaus/classworlds/DuplicateRealmException.class
org/codehaus/classworlds/Entry.class
org/codehaus/classworlds/Launcher.class
org/codehaus/classworlds/NoSuchRealmException.class
org/codehaus/classworlds/RealmClassLoader.class
org/codehaus/classworlds/UberJarRealmClassLoader.class
org/codehaus/classworlds/UrlUtils.class
org/codehaus/classworlds/uberjar/boot/Bootstrapper.class
org/codehaus/classworlds/uberjar/boot/InitialClassLoader.class
org/codehaus/classworlds/uberjar/protocol/jar/Handler.class
org/codehaus/classworlds/uberjar/protocol/jar/JarUrlConnection.class


Removing the classworlds jar from the classpath solves the problem, but it's not a nice solution. Is there a version of classworlds that does work with jspf?

Tx,
Kim Marivoet


Ralf

unread,
Jul 27, 2012, 5:03:46 AM7/27/12
to js...@googlegroups.com

Hi Kim, 

Unfortunately our version of ClassWorlds is quite deeply integrated into JSPF and cannot easily be replaced. I'm not aware of a "good" and easy solution to the problem, since we added a few patches to add a new constructors and tweak some internal class loading handling. 

One could rename JSPF's ClassWorlds internally, but unfortunately I don't have the time to do it at the moment.

Best,
Ralf

Kim Marivoet

unread,
Jul 27, 2012, 5:26:01 AM7/27/12
to js...@googlegroups.com
Hi Ralf,

Thanks for your answer. I guess the next best option then is to remove
the classworld dependency from the maven package. Do you know who
maintains the maven package for jspf?

Regards,
Kim
--
Kim Marivoet
Datadobi

T: +32489470353
E: kim.ma...@datadobi.com

Ralf Biedert

unread,
Jul 27, 2012, 5:27:51 AM7/27/12
to js...@googlegroups.com

Not right away. But there was a discussion on the list a few months ago. When you check the archives you should find who does.

Cheers,
Ralf

Quinton McCombs

unread,
Feb 17, 2014, 2:05:57 PM2/17/14
to js...@googlegroups.com
I know that this is an old post but there is a fairly easy way to rename all of the classworld classes as part of the build process.  You would use the JarJar ant task.  No changes needed to the source code at all!

Removing the dependency from the Maven POM will work as long as you don't have anything else that depends on ClassWorlds-1.0.  

Kim Marivoet

unread,
Feb 18, 2014, 4:19:01 AM2/18/14
to js...@googlegroups.com
Hi,

Thanks for the information! It's not really relevant anymore for this
particular problem (we're not using jspf anymore), but it might come
in handy for future dependencies.

Regards,
Kim
> --
> Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe
> "jspf" abonniert haben.
> Um Ihr Abonnement für dieses Thema zu beenden, rufen Sie die URL
> https://groups.google.com/d/topic/jspf/PbevxZaHarI/unsubscribe auf.
> Um Ihr Abonnement für diese Gruppe und alle ihre Themen zu beenden, senden
> Sie eine E-Mail an jspf+uns...@googlegroups.com.
> Weitere Optionen: https://groups.google.com/groups/opt_out
Reply all
Reply to author
Forward
0 new messages