3 Replies Latest reply on Jun 21, 2012 8:47 AM by Manoj Agarwal

    javax.inject.api module is not being recognized

    Manoj Agarwal Newbie

      Hi,

       

      I am trying to deploy a war file in JBoss AS 7.2.0 Alpha1 which have dependency on javax.inject.api module. I have added it in MANIFEST.MF but it seems its not being recognized as i get "ClassNotFoundException" for javax.inject.Provider.

       

      My MANIFEST.MF contains..

       

      Manifest-Version: 1.0

      Archiver-Version: Plexus Archiver

      Created-By: Apache Maven

      Built-By: agama05

      Build-Jdk: 1.7.0_02

      Dependencies: com.google.guice,javax.inject.api,com.google.guava

       

      And this is the error trace....

       

      13:09:40,813 ERROR [com.xy.abc.guice.GlobalInjector] (MSC service thread 1-1) Unable to initialize injector: java.lang.NoClassDefFoundError: javax/inject/Provider

          at com.google.inject.internal.MoreTypes.canonicalizeForKey(MoreTypes.java:81) [guice-3.0.jar:]

          at com.google.inject.Key.<init>(Key.java:119) [guice-3.0.jar:]

          at com.google.inject.Key.get(Key.java:212) [guice-3.0.jar:]

          at com.google.inject.spi.Elements$RecordingBinder.bind(Elements.java:262) [guice-3.0.jar:]

          at com.google.inject.internal.InjectorShell$RootModule.configure(InjectorShell.java:276) [guice-3.0.jar:]

          at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) [guice-3.0.jar:]

          at com.google.inject.spi.Elements.getElements(Elements.java:101) [guice-3.0.jar:]

          at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133) [guice-3.0.jar:]

          at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103) [guice-3.0.jar:]

          at com.google.inject.Guice.createInjector(Guice.java:95) [guice-3.0.jar:]

          at com.google.inject.Guice.createInjector(Guice.java:72) [guice-3.0.jar:]

          at com.google.inject.Guice.createInjector(Guice.java:62) [guice-3.0.jar:]

          at com.xy.abc.guice.GlobalInjector.<clinit>(GlobalInjector.java:35) [common-extension-3.0.0-20120620.111832-489.jar:]

          at com.xy.abc.server.startup.abcPrimordialJbossBean.start(abcPrimordialJbossBean.java:113) [abc-server-startup-3.0.0-20120620.111919-482.jar:]

          at com.xy.abc.StartupServlet.init(StartupServlet.java:29) [classes:]

          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.16.Final.jar:]

          at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.16.Final.jar:]

          at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.16.Final.jar:]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.16.Final.jar:]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_02]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_02]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_02]

      Caused by: java.lang.ClassNotFoundException: javax.inject.Provider from [Module "com.google.guice:main" from local module loader @13ba312 (roots: C:\Users\agama05\ProjectWork\abc_JBOSS\abc\abc-main\server\abc-server-run\target\abc\jboss\modules)]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)