Jboss 7.1.1: NamingException class can't be found

jcomouth

This RESTservice project is deployed on a Jboss 7.1.1 with Liferay SDK 6.2. 'javax.api' has already been added as dependency to the jboss-deployment-structure.xml, but this error appears anyway:

    09:11:28,741 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."RESTtest.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."RESTtest.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "RESTtest.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_51]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_51]
Caused by: java.lang.RuntimeException: Error getting reflective information for class de.foo.soa.myfoo.sales.MyfooSalesSF with ClassLoader ModuleClassLoader for Module "de.foo.soa.myfoo.modules:main" from local module loader @41c61c91 (roots: C:\fooTest\liferay-portal-JBOSS6.2-ce-ga2\jboss-7.1.1\modules)
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 5 more
Caused by: java.lang.NoClassDefFoundError: javax/naming/NamingException
    at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_51]
    at java.lang.Class.privateGetDeclaredFields(Unknown Source) [rt.jar:1.7.0_51]
    at java.lang.Class.getDeclaredFields(Unknown Source) [rt.jar:1.7.0_51]
    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 10 more
Caused by: java.lang.ClassNotFoundException: javax.naming.NamingException from [Module "de.foo.soa.myfoo.modules:main" from local module loader @41c61c91 (roots: C:\fooTest\liferay-portal-JBOSS6.2-ce-ga2\jboss-7.1.1\modules)]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
    ... 15 more

09:11:28,748 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "RESTtest.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"RESTtest.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"RESTtest.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"RESTtest.war\""}}
09:11:28,757 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment RESTtest.war in 9ms
09:11:28,758 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.unit."RESTtest.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."RESTtest.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "RESTtest.war"

A look in the module.xml of javax/api shows that javax/naming/NamingException is added as dependency, so everything should be fine:

        <dependencies>
        <system export="true">
            <paths>
                ...
                <path name="javax/naming"/>
                <path name="javax/naming/directory"/>
                <path name="javax/naming/event"/>
                <path name="javax/naming/ldap"/>
                <path name="javax/naming/spi"/>
                ...
            </paths>
        </system>
    </dependencies>

I look forward to any constructive suggestion.

eis

It seems you have added the javax api dependency to the jboss-deployment-structure.xml of your deployment, but if you look at your exception message:

ClassNotFoundException: javax.naming.NamingException from
    [Module "de.foo.soa.myfoo.modules:main"

it is missing from "de.foo.soa.myfoo.modules" module, not from your deployment. The modules module.xml file is where you need to add the dependency.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Class can't be found

From Dev

Class can't be found

From Dev

JBoss AS 7 and MySQL - Can't start server

From Dev

I can't install SP1 on Windows 7

From Dev

Class SimpleXMLIterator not found in zend framework 1 when zf create project ZendApp with PHP7

From Dev

Can't access JBoss AS 7 from remote machine

From Dev

Datasources only found on 1 site in IIS 7

From Dev

Can't handle @"1"

From Dev

Class not found in eval()'d code in line 1

From Dev

JAXB com.sun.xml.internal.bind.v2.ContextFactory Class Not Found in JBoss AS 7

From Dev

No message body writer has been found for response class ArrayList [jboss 7]

From Java

Migration jboss to tomcat - javax.naming.NamingException

From Dev

LWJGL Display class can't be found

From Dev

Class 'ServiceProvider' not found, can't autload serviceprovider

From Dev

Why I can't use SHA1 before PKCS7.detached in iText7?

From Dev

Can not stop Jboss7

From Dev

Can not stop Jboss7

From Dev

Configuration file not found - JBoss7

From Dev

Pysnmp can't get multiple oids if one of them is not found using SNMPv1

From Dev

Pysnmp can't get multiple oids if one of them is not found using SNMPv1

From Dev

JBoss CLI escaping SELECT 1

From Dev

Can't access public textBox7 created in form1, while in form2

From Dev

Can't print to parallel port LPT1 on docking station in Win7

From Dev

Can't get encrypted key out of pkcs7 envelope with PyAsn1 Python

From Dev

No WiFi Adaptor found in Lenovo X1 Carbon Generation 7

From Dev

Can't start jBoss AS 7.1

From Dev

Spark on Yarn job failed with ExitCode:1 and stderr says "Can't find main class"

From Dev

Can't run Google Earth with Ironhide - libGL.so.1 wrong elf class

From Dev

Can't run Google Earth with Ironhide - libGL.so.1 wrong elf class

Related Related

  1. 1

    Class can't be found

  2. 2

    Class can't be found

  3. 3

    JBoss AS 7 and MySQL - Can't start server

  4. 4

    I can't install SP1 on Windows 7

  5. 5

    Class SimpleXMLIterator not found in zend framework 1 when zf create project ZendApp with PHP7

  6. 6

    Can't access JBoss AS 7 from remote machine

  7. 7

    Datasources only found on 1 site in IIS 7

  8. 8

    Can't handle @"1"

  9. 9

    Class not found in eval()'d code in line 1

  10. 10

    JAXB com.sun.xml.internal.bind.v2.ContextFactory Class Not Found in JBoss AS 7

  11. 11

    No message body writer has been found for response class ArrayList [jboss 7]

  12. 12

    Migration jboss to tomcat - javax.naming.NamingException

  13. 13

    LWJGL Display class can't be found

  14. 14

    Class 'ServiceProvider' not found, can't autload serviceprovider

  15. 15

    Why I can't use SHA1 before PKCS7.detached in iText7?

  16. 16

    Can not stop Jboss7

  17. 17

    Can not stop Jboss7

  18. 18

    Configuration file not found - JBoss7

  19. 19

    Pysnmp can't get multiple oids if one of them is not found using SNMPv1

  20. 20

    Pysnmp can't get multiple oids if one of them is not found using SNMPv1

  21. 21

    JBoss CLI escaping SELECT 1

  22. 22

    Can't access public textBox7 created in form1, while in form2

  23. 23

    Can't print to parallel port LPT1 on docking station in Win7

  24. 24

    Can't get encrypted key out of pkcs7 envelope with PyAsn1 Python

  25. 25

    No WiFi Adaptor found in Lenovo X1 Carbon Generation 7

  26. 26

    Can't start jBoss AS 7.1

  27. 27

    Spark on Yarn job failed with ExitCode:1 and stderr says "Can't find main class"

  28. 28

    Can't run Google Earth with Ironhide - libGL.so.1 wrong elf class

  29. 29

    Can't run Google Earth with Ironhide - libGL.so.1 wrong elf class

HotTag

Archive