Originally reported by ulrik.sandberg, Apr 17, 2009, against the
onejar-maven-plugin.
I believe the problem is in One-JAR's classloading.
Original (and properly formatted) bug reports regarding this are here:
http://blog.jayway.com/2009/03/22/executable-jar-with-onejar-maven-plugin/#
comment-3788
http://code.google.com/p/onejar-maven-plugin/issues/detail?id=12
Best regards,
Hugo Josefson
---------------------------------------------------------------------------
-
What version of the product are you using? On what operating system?
onejar-maven-plugin 1.4.0, Windows XP
What steps will reproduce the problem?
Using onejar-maven-plugin in an annotation-based Spring project.
Chances are that it’s the classpath scanning that is the problem.
I had the following setup:
Class:
package com.example;
@Component("transformer")
public class MyTransformer {
Spring config:
<context:component-scan base-package="com.example" />
Bootstrapping code:
public static void main(String[] args) {
ApplicationContext context = new
ClassPathXmlApplicationContext("applicationContext.xml");
MyTransformer transformer = (MyTransformer)
context.getBean("transformer");
transformer.run();
}
I got the following exception:
NoSuchBeanDefinitionException: No bean named 'transformer' is defined
I then switched to this config, still using annotation-based
dependency
autowire, but requiring an explicit bean definition:
Spring config:
<context:annotation-config />
<bean id="transformer" class="com.example.MyTransformer" />
Nobody/Anonymous
Classloading
None
Public
|
Date: 2009-10-22 12:47 Problem is in JarClassLoader, it's "protected void loadByteCode(InputStream |
|
Date: 2009-09-08 14:08 +1 |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use