geronimo-xbean-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacek Laskowski <ja...@laskowski.net.pl>
Subject Re: xbean 3.7-snapshot deployed
Date Sun, 31 Jan 2010 13:48:54 GMT
2010/1/30 Jacek Laskowski <jacek@laskowski.net.pl>:

> Just to let you know that the latest (01/30) xbean has just been
> deployed to the snapshot repo.

...and I don't think it was a wise move. I think it contains a NCDF
issue with org.objectweb.asm package. I'm on MacOS with Java 6:

devmac:xbean-finder-shaded jacek$ java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
devmac:xbean-finder-shaded jacek$ uname -a
Darwin devmac.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov  3
10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386

and the more I look into it the more I'm convinced to think there's a
bug with shading on this platform.

I created a simple app:

package pl.jaceklaskowski.mavenproject1;

import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
import javax.jws.WebService;
import org.apache.xbean.finder.ClassFinder;

public class NewClass {
  public static void main(String[] args) throws Exception {
    URL[] urls = new URL[] { File.createTempFile("aaa", "bbb").toURI().toURL()};
    ClassFinder finder = new ClassFinder(new URLClassLoader(urls));
    finder.findAnnotatedClasses(WebService.class);
  }
}

with the following pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>pl.jaceklaskowski</groupId>
  <artifactId>mavenproject1</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>mavenproject1</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-finder-shaded</artifactId>
      <version>3.7-SNAPSHOT</version>
    </dependency>
  </dependencies>
</project>

When I run it with the current configuration, i.e. with
xbean-finder-shaded-3.7-SNAPSHOT.jar which is replaced right after the
shading process it blows up with:

[Loaded org.apache.xbean.finder.ClassFinder from
file:/Users/jacek/.m2/repository/org/apache/xbean/xbean-finder-shaded/3.7-SNAPSHOT/xbean-finder-shaded-3.7-SNAPSHOT.jar]
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/xbean/asm/ClassVisitor
        at pl.jaceklaskowski.mavenproject1.NewClass.main(NewClass.java:21)
Caused by: java.lang.ClassNotFoundException: org.apache.xbean.asm.ClassVisitor
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
        ... 1 more

I run the sample with -verbose:class to see where the ClassVisitor
class comes from - you can see the result a line above the exception.

When I change the pom.xml with:

    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-finder-shaded</artifactId>
      <version>3.7-SNAPSHOT</version>
      <classifier>shaded</classifier>
    </dependency>

and do

  <shadedArtifactAttached>true</shadedArtifactAttached>

in the xbean-finder-shaded's pom.xml it works fine.

Anybody can shed some light on it? I'm stuck with the change in xbean
for asm parsing of generic classes. I'm looking into it right now
(which makes 2-day hard thinking on it and I feel my brain's melting
down). Help!

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://wszystkojawne.pl
p.s. Szukam speca/firmy od grafiki/CSS/HTML

Mime
View raw message