1 2 Previous Next 24 Replies Latest reply on Jun 27, 2014 6:30 PM by piwaf

    Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider

    rumiat

      I am using JBoss 7 and JDK1.6 update 26.

       

      When I try to connect to another application which is running in Tomcat I am getting following exception. Any idea - what I am missing?

        • 1. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
          rumiat

          Exception is

           

          Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider

          • 2. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
            swd847

            Can you post the full stack trace?

            • 3. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
              rumiat

              Following is the stack trace

               

              Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
              at com.my.application.ApplicationAction.getStatus(ApplicationAction.java:41)
              at com.my.application.ApplicationAction.getStatus(ApplicationAction.java:35)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
              at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)
              at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:114)
              at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:122)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
              at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
              at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
              at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
              at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
              at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
              at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:67)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
              at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
              at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)
              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:271)
              ... 63 more
              Caused by: java.lang.ClassNotFoundException: com.sun.net.ssl.internal.ssl.Provider from [Module "deployment.operation-app.war:main" from Service Module Loader]
              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

              • 4. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                rumiat

                The same code is working fine in JBoss 6 I can't figure out why I am getting ClassNotFoundException in JBoss7

                 

                I think it is the class already included in JRE.

                 

                I can see the new modular approach in JBoss7 so do I need to define module.xml file for this exception? Though I did it but no success

                • 5. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                  wolfc

                  Are you using this internal class directly?

                   

                  You need to define a module definition a.k.a. com.sun.security.

                  Plus you need to add a dependency in your war onto that module.

                  • 6. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                    rumiat

                    Thanks Stuart and Carlo!

                     

                    So far no success,

                     

                    Carlo I am not using it directly as I am using jar which internally call this class for some reason. This is working fine in JBoss6 but not working in 7.0 and 7.1.0 snapshot.

                     

                    What do you mean by module definition. I think com.sun.security is already defined in JBoss modules directory like I can see following module.xml at <JBOSS-ROOT>\modules\com\sun\security\main\module.xml

                     

                    Further I have added com.sun.security in my standalone.xml in the module section like this

                     

                    <modules>

                                    <module identifier="com.sun.security"/>

                                    <module identifier="javaee.api"/>

                                    <module identifier="org.jboss.logging"/>

                                   .

                                   .

                                   .

                    </modules>

                     

                    I really appreciate your help but still waiting desperately to fix this issue

                    • 7. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                      swd847

                      The <modules> section in standalone.xml is something totally different (part of the osgi subsystem).

                       

                      You need to add a dependency entry to your deployment, unfortunatly it does not look like there is a pre-defined module that has these classes. This leaves you with 2 options, either add a dependency on the system module, or use jboss-deployment-structure.xml to import just the classes you need.

                       

                      To import the whole system module add the following line to MANIFEST.MF (making sure that there is a newline at the end of the file):

                       

                      Dependencies: system

                       

                      To import it using jboss-deployment-structure.xml:

                       

                      <jboss-deployment-structure>

                        <deployment>

                          <dependencies>

                            <module name="system" >

                               <imports>

                                  <include-set>

                                     <path name="com/sun/ssl/internal/ssl"/>

                                   </include-set>

                                </imports>

                              </module>

                          </dependencies>

                        </deployment>

                      </jboss-deployment-structure>

                       

                       

                      Also see this page: https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7

                      • 8. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                        rumiat

                        Thank you so much Stuart! You solved my problem.

                         

                        I could have fixed it through MANIFEST.MF. Though I have tried jboss-deployment-structure.xml but it never changed anything, I don't know what I was missing with this procedure. Anyways I really appreciate your help

                         

                        Bundles of Thanks Stuart!

                        • 9. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                          richyclarke

                          Hi,

                          I was having the same issue with the no class def found for com/sun/net/ssl/internal/ssl/Provider

                           

                          I think there is a </module> missing in the  jboss-deployment-structure.xml code given above?

                           

                          I am am getting the following error...

                          `Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Error loading jboss-structure.xml from C:\jboss-as-7.0.0.Final\standalone\tmp\vfs\tempbe65e9afbe976d90\searchpoint.war-e4072269ff660cef\WEB-INF\jboss-deployment-st

                          ructure.xml

                                  at org.jboss.as.server.deployment.module.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:402)

                                  at org.jboss.as.server.deployment.module.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:375)

                                  at org.jboss.as.server.deployment.module.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:289)

                                  at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)

                                  ... 5 more

                          Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </dependencies>; expected </module>.

                          at [row,col {unknown-source}]: [10,18]

                                  at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:606)

                                  at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:479)

                                  at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:464)

                                  at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java:3248)

                                  at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3175)

                                  at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2794)

                                  at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1050)

                                  at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1125)

                                  at org.jboss.as.server.deployment.module.DeploymentStructureDescriptorParser.parseModuleDependency(DeploymentStructureDescriptorParser.java:772)

                                  at org.jboss.as.server.deployment.module.DeploymentStructureDescriptorParser.parseDependencies(DeploymentStructureDescriptorParser.java:718)

                                  at org.jboss.as.server.deployment.module.DeploymentStructureDescriptorParser.parseModuleStructureSpec(DeploymentStructureDescriptorParser.java:683)

                                  at org.jboss.as.server.deployment.module.DeploymentStructureDescriptorParser.parseDeployment(DeploymentStructureDescriptorParser.java:599)

                                  at org.jboss.as.server.deployment.module.DeploymentStructureDescriptorParser.parseStructureContents(DeploymentStructureDescriptorParser.java:575)

                                  at org.jboss.as.server.deployment.module.DeploymentStructureDescriptorParser.parseDocument(DeploymentStructureDescriptorParser.java:510)

                                  at org.jboss.as.server.deployment.module.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:396)

                                  ... 8 more

                          `

                           

                          Inserting the closing </module> tag fixed this.

                           

                          I think the correct code is therefore...

                           

                          `

                          <jboss-deployment-structure>

                            <deployment>

                              <dependencies>

                                <module name="system" >

                                <imports>

                                    <include-set>

                                         <path name="com/sun/ssl/internal/ssl"/>

                                     </include-set>

                                 </imports>

                                 </module>

                              </dependencies>

                            </deployment>

                          </jboss-deployment-structure>

                           

                          `

                          • 10. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                            rumiat

                            Hi Richard,

                             

                            Yes I got noticed when I was adding this xml in my jboss-deployment-structure.xml and fixed it this way but it never worked for me. May be I am missing something else by the way I think this is the more appropriate way of fixing this issue in my understanding and I would love to know if I can get to know what I missed actually.

                             

                            Let me tell you my jboss-deployment-structure.xml contains only this code and there is no reference in the project for it. should it be like that? or you have configured it somewhere else?

                            • 11. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                              spiritfox26

                              I have the some problem but the exception is java.lang.ClassNotFoundException: org.xml.sax.SAXException. This class is in rt.jar and is alocated in C:\Program Files\Java\jre6\lib and C:\Program Files\Java\jdk1.6.0_22\jre\lib too.

                               

                              Anyone have a solution for this?

                              • 12. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                                quanlin

                                when you tried to migrate your application from old JBoss AS released to new JBoss 7, you need to add dependencies in your web app's manifest file, My suggestion is, read that section from the manual first:

                                 

                                https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7

                                 

                                and then you will have to clear picture of how to do that in JBoss 7.

                                 

                                the basic idea is your web app will reference the common module predefined in JBoss 7 first and then try to deploy your web app, more information can be found in class loading section.

                                • 13. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                                  cavi

                                  I nearly have the same error..using jdk 1.7 & jboss 7.1.1.Final ........ & how to check for the dependency.....where i can find the MANIFEST.MF.

                                   

                                   

                                  17:30:30,661 ERROR [stderr] (LBAdminGlobalDataReloader) Exception in thread "LBAdminGlobalDataReloader" java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider

                                  17:30:30,937 ERROR [stderr] (LBAdminGlobalDataReloader)     at java.lang.Class.forName0(Native Method)

                                  17:30:31,062 ERROR [stderr] (LBAdminGlobalDataReloader)     at java.lang.Class.forName(Class.java:264)

                                  17:30:31,184 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.util.BeanUtil.getClassObject(BeanUtil.java:54)

                                  17:30:31,318 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.util.XmlObjectFactory.createBeanInstanceFromClassDef(XmlObjectFactory.java:515)

                                  17:30:31,478 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.util.XmlObjectFactory.createObject(XmlObjectFactory.java:471)

                                  17:30:31,609 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.component.DefaultComponentManager.createComponentBean(DefaultComponentManager.java:226)

                                  17:30:31,808 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.component.DefaultComponentManager.createComponentBean(DefaultComponentManager.java:218)

                                  17:30:32,013 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.component.DefaultComponentManager.resolveBean(DefaultComponentManager.java:377)

                                  17:30:32,174 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.component.DefaultComponent.resolveBean(DefaultComponent.java:142)

                                  17:30:32,301 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.component.ComponentPathSegment.resolve(ComponentPathSegment.java:61)

                                  17:30:32,436 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.component.ComponentPath.resolve(ComponentPath.java:251)

                                  17:30:32,568 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.component.DefaultComponentManager.resolvePath(DefaultComponentManager.java:329)

                                  17:30:32,884 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.WRequest.resolvePath(WRequest.java:1016)

                                  17:30:33,076 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.erpsapccn.bs.lb.admin.ApplicationObjects.getADDataLayer(ApplicationObjects.java:211)

                                  17:30:33,220 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.erpsapccn.bs.lb.admin.GlobalData.reloadADGroupsStructure(GlobalData.java:3282)

                                  17:30:33,344 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.erpsapccn.bs.lb.admin.GlobalData.reloadData(GlobalData.java:358)

                                  17:30:33,394 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.erpsapccn.bs.lb.admin.AdminGlobalDataReloader.doExecute(AdminGlobalDataReloader.java:42)

                                  17:30:33,624 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.erpsapccn.bs.lb.admin.AdminGlobalDataReloader.execute(AdminGlobalDataReloader.java:30)

                                  17:30:33,932 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.util.thread.Worker.executeThreadJob(Worker.java:199)

                                  17:30:34,122 ERROR [stderr] (LBAdminGlobalDataReloader)     at st.iotrx.util.thread.Worker.run(Worker.java:166)

                                  17:30:34,249 ERROR [stderr] (LBAdminGlobalDataReloader) Caused by: java.lang.ClassNotFoundException: com.sun.net.ssl.internal.ssl.Provider from [Module "deployment.lb.war:main" from Service Module Loader]

                                  17:30:34,430 ERROR [stderr] (LBAdminGlobalDataReloader)     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                                  17:30:34,559 ERROR [stderr] (LBAdminGlobalDataReloader)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                                  17:30:34,725 ERROR [stderr] (LBAdminGlobalDataReloader)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                                  17:30:34,878 ERROR [stderr] (LBAdminGlobalDataReloader)     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                                  17:30:35,035 ERROR [stderr] (LBAdminGlobalDataReloader)     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                                  17:30:35,152 ERROR [stderr] (LBAdminGlobalDataReloader)     ... 20 more

                                  • 14. Re: Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
                                    quanlin

                                    Hi Cavi,

                                     

                                    Based on my experience, you could either use the tool called "Tattletale" to find the dependency in your application or just run several times of your app and dig out those dependencies based on the error log. I've given the link above your reply, you should take a look at that if you haven't.

                                     

                                    To your second question, if you can't find your MINIFEST.MF file in META-INF folder in your webapp folder (if I remember correctly), then you should create it by yourself, and add those dependencies that your find respectively. And don't forget to add a line break at the end of the file. I think this will help you to solve your problem or at least get you closer.

                                    1 2 Previous Next