Hi Pete, I'm confused, I'd like to use weld in pure Java SE apps that can be run with "java -cp ..", I thought the maven java app I build can be used in such way, no?
Tony On Thu, Oct 11, 2012 at 7:55 AM, Pete Muir <pm...@redhat.com> wrote: > Definitely use weld-se-core for DeltaSpike, weld-se is for people who are > using pure Java SE with no classpath control (like Maven) -i.e. doing java > -cp :-) > > On 10 Oct 2012, at 18:35, Tony Lam wrote: > > > Hi, > > > > Switching to org.jboss.weld.se:weld-se or weld-se-core fixed the > problem! > > > > Here are the dependencies I have now: > > > > <dependency> > > <groupId>org.apache.deltaspike.cdictrl</groupId> > > <artifactId>deltaspike-cdictrl-api</artifactId> > > <version>0.3-incubating</version> > > </dependency> > > <dependency> > > <groupId>org.apache.deltaspike.cdictrl</groupId> > > <artifactId>deltaspike-cdictrl-weld</artifactId> > > <version>0.3-incubating</version> > > </dependency> > > <dependency> > > <groupId>org.jboss.weld.se</groupId> > > <artifactId>weld-se-core</artifactId> > > <version>1.1.9.Final</version> > > </dependency> > > > > Maybe this should be included as part of FAQ? > > > > Thanks all for your help! > > > > Regards, > > > > Tony > > > > > > On Wed, Oct 10, 2012 at 9:47 AM, Harald Wellmann <hwellmann...@gmail.com > >wrote: > > > >> Are you using org.jboss.weld:weld-se? Recent artifacts are called > >> org.jboss.weld.se:weld-se (groupId changed). > >> > >> Also, you can use weld-se-core instead of weld-se which is a shaded JAR > >> that may or may not cause conflicts in your environment. > >> > >> Best regards, > >> Harald > >> > >> > >> Am 10.10.2012 17:54, schrieb Tony Lam: > >> > >> Hi, > >>> > >>> While there are later version of weld-core (v1.1.9.Final) available, > the > >>> latest version of weld-se I can find is 1.0.1-Final, and running with > >>> these > >>> two latest versions produced the same error. > >>> > >>> Did I miss something? > >>> > >>> Thanks for the help. > >>> > >>> Regards, > >>> > >>> Tony > >>> > >>> On Wed, Oct 10, 2012 at 2:03 AM, Mark Struberg <strub...@yahoo.de> > wrote: > >>> > >>> Yes, I would at least use 1.1.5.Final or even a later version. > >>>> > >>>> LieGrue, > >>>> strub > >>>> > >>>> > >>>> > >>>> > >>>> ----- Original Message ----- > >>>> > >>>>> From: Harald Wellmann <hwellmann...@gmail.com> > >>>>> To: deltaspike-users@incubator.**apache.org< > deltaspike-users@incubator.apache.org> > >>>>> Cc: > >>>>> Sent: Wednesday, October 10, 2012 9:31 AM > >>>>> Subject: Re: trouble running a simple test program > >>>>> > >>>>> It seems you're mixing up two different Weld versions: 1.0.1-Final > vs. > >>>>> 1.1.5.Final. > >>>>> > >>>>> Best regards, > >>>>> Harald > >>>>> > >>>>> 2012/10/10 Charles Moulliard <ch0...@gmail.com>: > >>>>> > >>>>>> Hi, > >>>>>> > >>>>>> Can you check the code please as it seems that you have different > >>>>>> > >>>>> versions > >>>> > >>>>> of the same class (perhaps providing by 2 different jars) or you > have > >>>>>> changed some classes between compilation and running ( > >>>>>> > >>>>>> > >>>>> > http://stackoverflow.com/**questions/1980452/what-causes-**java-lang-* > >>>> *incompatibleclasschangeerror< > http://stackoverflow.com/questions/1980452/what-causes-java-lang-incompatibleclasschangeerror > > > >>>> > >>>>> ). > >>>>>> > >>>>>> Regards, > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> On Wed, Oct 10, 2012 at 8:32 AM, Tony Lam <tonysw...@gmail.com> > >>>>>> > >>>>> wrote: > >>>>> > >>>>>> > >>>>>> Hi, > >>>>>>> > >>>>>>> I'm a CDI newbie and I'm trying to run a simple test program to > >>>>>>> > >>>>>> try out > >>>>> > >>>>>> cdiContainer with weld, but I'm getting the exception below: > >>>>>>> > >>>>>>> com.google.common.collect.**ComputationException: > >>>>>>> java.lang.**IncompatibleClassChangeError: Implementing class > >>>>>>> > >>>>>>> Can you advise how to fix it? Let me know if you'd like to see the > >>>>>>> > >>>>>> test > >>>>> > >>>>>> program I used. > >>>>>>> > >>>>>>> I have included the pom dependencies and exception stack traces > >>>>>>> below. > >>>>>>> > >>>>>>> Thanks. > >>>>>>> > >>>>>>> Tony > >>>>>>> > >>>>>>> pom.xml: > >>>>>>> ... > >>>>>>> <dependencies> > >>>>>>> <dependency> > >>>>>>> <groupId>org.apache.**deltaspike.cdictrl</groupId> > >>>>>>> <artifactId>deltaspike-**cdictrl-api</artifactId> > >>>>>>> <version>0.3-incubating</**version> > >>>>>>> </dependency> > >>>>>>> <dependency> > >>>>>>> <groupId>org.apache.**deltaspike.cdictrl</groupId> > >>>>>>> <artifactId>deltaspike-**cdictrl-weld</artifactId> > >>>>>>> <version>0.3-incubating</**version> > >>>>>>> </dependency> > >>>>>>> <dependency> > >>>>>>> <groupId>org.jboss.weld</**groupId> > >>>>>>> <artifactId>weld-se</**artifactId> > >>>>>>> <version>1.0.1-Final</version> > >>>>>>> </dependency> > >>>>>>> <dependency> > >>>>>>> <groupId>org.jboss.weld</**groupId> > >>>>>>> <artifactId>weld-core</**artifactId> > >>>>>>> <version>1.1.5.Final</version> > >>>>>>> </dependency> > >>>>>>> </dependencies> > >>>>>>> > >>>>>>> 79 [main] INFO org.jboss.weld.Version - WELD-000900 1.0.1 (Final) > >>>>>>> 100 [main] INFO org.jboss.weld.Bootstrap - WELD-000101 > Transactional > >>>>>>> services not available. Injection of @Inject UserTransaction not > >>>>>>> > >>>>>> available. > >>>>> > >>>>>> Transactional observers will be invoked synchronously. > >>>>>>> Exception in thread "main" > >>>>>>> > >>>>>> com.google.common.collect.**ComputationException: > >>>>> > >>>>>> java.lang.**IncompatibleClassChangeError: Implementing class > >>>>>>> at > >>>>>>> > >>>>>>> > >>>>> com.google.common.collect.**MapMaker$StrategyImpl.compute(** > >>>> MapMaker.java:602) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>> com.google.common.collect.**MapMaker$StrategyImpl.compute(** > >>>> MapMaker.java:462) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> com.google.common.collect.**CustomConcurrentHashMap$** > >>>> ComputingImpl.get(**CustomConcurrentHashMap.java:**2045) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.resources.**ClassTransformer.loadClass(** > >>>> ClassTransformer.java:164) > >>>> > >>>>> at > >>>>>>> > >>>>>> org.jboss.weld.bootstrap.**BeanDeployer.addClass(** > >>>> BeanDeployer.java:61) > >>>> > >>>>> at > >>>>>>> > >>>>>> org.jboss.weld.bootstrap.**BeanDeployer.addClasses(** > >>>>> BeanDeployer.java:88) > >>>>> > >>>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.bootstrap.**BeanDeployment.deployBeans(** > >>>> BeanDeployment.java:134) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.bootstrap.**WeldBootstrap.deployBeans(** > >>>> WeldBootstrap.java:377) > >>>> > >>>>> at org.jboss.weld.environment.se.**Weld.initialize(Weld.java:79) > >>>>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.apache.deltaspike.cdise.**weld.WeldContainerControl.** > >>>> boot(WeldContainerControl.**java:61) > >>>> > >>>>> at my.cdicontainer.Main.main(**Main.java:16) > >>>>>>> Caused by: java.lang.**IncompatibleClassChangeError: Implementing > >>>>>>> class > >>>>>>> at java.lang.ClassLoader.**defineClass1(Native Method) > >>>>>>> at java.lang.ClassLoader.**defineClass(ClassLoader.java:**791) > >>>>>>> at > >>>>>>> > >>>>>> java.security.**SecureClassLoader.defineClass(** > >>>>> SecureClassLoader.java:142) > >>>>> > >>>>>> at java.net.URLClassLoader.**defineClass(URLClassLoader.**java:449) > >>>>>>> at java.net.URLClassLoader.**access$100(URLClassLoader.**java:71) > >>>>>>> at java.net.URLClassLoader$1.run(**URLClassLoader.java:361) > >>>>>>> at java.net.URLClassLoader$1.run(**URLClassLoader.java:355) > >>>>>>> at java.security.**AccessController.doPrivileged(**Native Method) > >>>>>>> at java.net.URLClassLoader.**findClass(URLClassLoader.java:**354) > >>>>>>> at java.lang.ClassLoader.**loadClass(ClassLoader.java:**423) > >>>>>>> at sun.misc.Launcher$**AppClassLoader.loadClass(** > >>>>>>> Launcher.java:308) > >>>>>>> at java.lang.ClassLoader.**loadClass(ClassLoader.java:**356) > >>>>>>> at java.lang.Class.**getDeclaredFields0(Native Method) > >>>>>>> at java.lang.Class.**privateGetDeclaredFields(**Class.java:2308) > >>>>>>> at java.lang.Class.**getDeclaredFields(Class.java:**1760) > >>>>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.util.**reflection.SecureReflections$** > >>>> 4.work(SecureReflections.java:**115) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.util.**reflection.SecureReflections$** > >>>> 4.work(SecureReflections.java:**111) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.util.**reflection.**SecureReflectionAccess.run(** > >>>> SecureReflectionAccess.java:**54) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.util.**reflection.**SecureReflectionAccess.** > >>>> runAndWrap(**SecureReflectionAccess.java:**67) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.util.**reflection.SecureReflections.** > >>>> getDeclaredFields(**SecureReflections.java:110) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.introspector.**jlr.WeldClassImpl.<init>(** > >>>> WeldClassImpl.java:177) > >>>> > >>>>> at > >>>>>>> > >>>>>> org.jboss.weld.introspector.**jlr.WeldClassImpl.of(** > >>>>> WeldClassImpl.java:140) > >>>>> > >>>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.resources.**ClassTransformer$** > >>>> TransformTypeToWeldClass.**apply(ClassTransformer.java:**50) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> org.jboss.weld.resources.**ClassTransformer$** > >>>> TransformTypeToWeldClass.**apply(ClassTransformer.java:**38) > >>>> > >>>>> at > >>>>>>> > >>>>>>> > >>>>> com.google.common.collect.**MapMaker$StrategyImpl.compute(** > >>>> MapMaker.java:592) > >>>> > >>>>> ... 10 more > >>>>>>> > >>>>>>> > >>>>>> > >>>>>> > >>>>>> -- > >>>>>> Charles Moulliard > >>>>>> Apache Committer / Sr. Enterprise Architect (RedHat) > >>>>>> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com > >>>>>> > >>>>> > >>>>> > >>>> > >>> > >> > >