4 Replies Latest reply on Aug 22, 2013 2:45 AM by Lukasz Sroka

    camel WARN java.lang.StackOverflowError

    Lukasz Sroka Newbie

      Hello.

      Like in subject I have following WARN which hangs whole server. It hapens when I call my service from webapp by @Injection.
      Strange thing is that it happens form time to time after server restart.

      For me this WARN should not  hangs the server, but it do it.

      I found in camel src that it should be loged.

      https://svn.apache.org/repos/asf/camel/tags/camel-2.10.0/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java

      Please use ctrl+f "Caught unhandled exception while processing ExchangeId"

       

      LOG.warn("Caught unhandled exception while processing ExchangeId: " + exchange.getExchangeId(), e);


      I use EAP6.1 with switchyard 1.0.0 installed via ant script form tutorial pages.
      Any help, advice very needed.

       

      P.S.

      I use eclipse kepler with jboss and switchyard tools on linux machine.

       

       

      15:07:05,662 WARN  [org.apache.camel.processor.UnitOfWorkProcessor] (http-/0.0.0.0:8080-1) Caught unhandled exception while processing ExchangeId: ID-lukasz-pc-49443-1376485610739-2-522: java.lang.StackOverflowError

          at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_25]

          at java.lang.ClassLoader.defineClass(ClassLoader.java:792) [rt.jar:1.7.0_25]

          at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:344) [jboss-modules.jar:1.2.0.Final-redhat-1]

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:422) [jboss-modules.jar:1.2.0.Final-redhat-1]

          at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:260) [jboss-modules.jar:1.2.0.Final-redhat-1]

          at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:75) [jboss-modules.jar:1.2.0.Final-redhat-1]

          at org.jboss.modules.Module.loadModuleClass(Module.java:526) [jboss-modules.jar:1.2.0.Final-redhat-1]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188) [jboss-modules.jar:1.2.0.Final-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]

          at org.apache.camel.impl.DefaultMessage.toString(DefaultMessage.java:46) [camel-core-2.10.0.jar:2.10.0]

          at java.lang.String.valueOf(String.java:2854) [rt.jar:1.7.0_25]

          at java.lang.StringBuilder.append(StringBuilder.java:128) [rt.jar:1.7.0_25]

          at org.apache.camel.impl.DefaultExchange.toString(DefaultExchange.java:80) [camel-core-2.10.0.jar:2.10.0]

          at java.lang.String.valueOf(String.java:2854) [rt.jar:1.7.0_25]

          at java.lang.StringBuilder.append(StringBuilder.java:128) [rt.jar:1.7.0_25]

          at org.apache.camel.RuntimeExchangeException.createMessage(RuntimeExchangeException.java:49) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.RuntimeExchangeException.<init>(RuntimeExchangeException.java:34) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.CamelExecutionException.<init>(CamelExecutionException.java:35) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1296) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:282) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:64) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.10.0.jar:2.10.0]

          at org.switchyard.bus.camel.audit.FaultProcessor.process(FaultProcessor.java:44) [switchyard-bus-camel-1.0.0.Final.jar:1.0.0.Final]

          at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) [camel-core-2.10.0.jar:2.10.0]

          at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) [camel-core-2.10.0.jar:2.10.0]

        • 1. Re: camel WARN java.lang.StackOverflowError
          Keith Babo Master

          Can you provide an app to reproduce this issue?  The route definition and switchyard.xml are needed at a minimum to provide more help.

          • 2. Re: camel WARN java.lang.StackOverflowError
            Lukasz Sroka Newbie

            For a reason of confidentiality of source code in my company i can not provide full app.

             

            I will explain this in details as much as i can.

            We are developing some SOA solution for our company which consists of several projects like: web frontend, user management, security, device management and so on...

             

            Everythink is deploying on one server EAP 6.1 with switchyard and we are injecting services from one project to another.

            This problem happens when service from user management project was injected into two project: web frontend and security project.

             

            This is switchyard.xml from web fronten app.

             

            <?xml version="1.0" encoding="UTF-8"?>
            <switchyard xmlns="urn:switchyard-config:switchyard:1.0"
                xmlns:sy="urn:switchyard-config:switchyard:1.0" xmlns:bean="urn:switchyard-component-bean:config:1.0"
                xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="atsp-musdonet"
                targetNamespace="urn:com.asb.atsp:atsp-musdonet:1.0-SNAPSHOT">
                <sca:composite name="atsp-musdonet"
                    targetNamespace="urn:com.asb.atsp:atsp-musdonet:1.0-SNAPSHOT">
                    <sca:reference name="UserManagementService"
                        multiplicity="0..1" promote="RegistrationPageBean/UserManagementService">
                        <sca:interface.java
                            interface="com.asb.soa.user.management.UserManagementService" />
                        <sca:binding.sca sy:targetNamespace="urn:com.asb.soa" />
                    </sca:reference>
                    <sca:component name="RegistrationPageBean">
                        <bean:implementation.bean class="com.asb.atsp.page.RegistrationPageBean" />
                        <sca:reference name="UserManagementService">
                            <sca:interface.java
                                interface="com.asb.soa.user.management.UserManagementService" />
                        </sca:reference>
                    </sca:component>
                </sca:composite>
            </switchyard>
            

            web frontend injection class:

             

            @Named("registrationPage")
            @RequestScoped
            public class RegistrationPageBean implements Serializable {
            
                @Inject
                @Reference
                private UserManagementService userService;
            

            ==================== securty project ==============

             

            this is switchyard.xml from security project

             

            <?xml version="1.0" encoding="UTF-8"?>
            <switchyard xmlns="urn:switchyard-config:switchyard:1.0" xmlns:sy="urn:switchyard-config:switchyard:1.0" xmlns:bean="urn:switchyard-component-bean:config:1.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="security" targetNamespace="urn:com.asb.soa">
              <sca:composite name="security" targetNamespace="urn:com.asb.soa">
                <sca:service name="SetupSingletonLocal" promote="SetupSingleton/SetupSingletonLocal">
                  <sca:interface.java interface="com.asb.soa.security.initializers.SetupSingletonLocal"/>
                </sca:service>
                <sca:component name="SetupSingleton">
                  <bean:implementation.bean class="com.asb.soa.security.initializers.SetupSingleton"/>
                  <sca:service name="SetupSingletonLocal">
                    <sca:interface.java interface="com.asb.soa.security.initializers.SetupSingletonLocal"/>
                  </sca:service>
                  <sca:reference name="UserManagementService">
                    <sca:interface.java interface="com.asb.soa.user.management.UserManagementService"/>
                  </sca:reference>
                </sca:component>
                <sca:reference name="UserManagementService" multiplicity="0..1" promote="SetupSingleton/UserManagementService">
                  <sca:interface.java interface="com.asb.soa.user.management.UserManagementService"/>
                  <sca:binding.sca sy:targetNamespace="urn:com.asb.soa"/>
                </sca:reference>
                <sca:component name="Dummy">
                  <bean:implementation.bean class="com.asb.soa.security.initializers.Dummy"/>
                  <sca:reference name="SetupSingletonLocal">
                    <sca:interface.java interface="com.asb.soa.security.initializers.SetupSingletonLocal"/>
                  </sca:reference>
                </sca:component>
              </sca:composite>
            </switchyard>
            

            and injection class:

             

            @Service(SetupSingletonLocal.class)
            public class SetupSingleton implements SetupSingletonLocal {
            
                @Inject
                @Reference
                private UserManagementService user;
            

            and here is dummy startup class.

             

            @Singleton 
            @Startup 
            @LocalBean 
            public class Dummy { 
            
                @Inject 
                @Reference 
                private SetupSingletonLocal securityInitializer;
            

             

             

            EAP was starting ok but when i call in web frontend service method eg. createUser it crashes with stackoverflow from time to time.
            Lets say on 10 eap starts it crashes 6-7 times when i call service.
            But when i remove from SetupSingleton class this injection it works every time.

            For now i gave up any injection into security project and did it some oher way.

            Now i dont need this injection but it is still strange for me.

            In my web frontend i use richfaces 4.3.3 as server module because we plan to have another web app which use services.

            here is module.xml form eap module directory

             

            <module xmlns="urn:jboss:module:1.1" name="org.richfaces" slot="main">
                <resources>
                    <resource-root path="richfaces-core-api-4.3.3.Final.jar"/>
                    <resource-root path="richfaces-core-impl-4.3.3.Final.jar"/>
                    <resource-root path="richfaces-components-api-4.3.3.Final.jar"/>
                    <resource-root path="richfaces-components-ui-4.3.3.Final.jar"/>
                </resources>
                <dependencies>
                  <module name="org.w3c.css.sac"/>
                  <module name="net.sourceforge.cssparser"/>
                  <module name="com.sun.jsf-impl"/>
                  <module name="javax.api"/>
                  <module name="javax.faces.api"/>
                  <module name="javax.xml.bind.api"/>
                  <module name="javax.xml.jaxp-provider"/>
                  <module name="com.google.guava"/>
                  <module name="org.atmosphere"/>
                </dependencies>
            </module>
            

             

            And i also have another strange issue with web app which happens form time to time when eap is starting.

            Unable to parse document 'jndi:/default-host/atsp-musdonet/WEB-INF/faces-config.xml': null

            Now i dont have full stack trace but maybe this have something to do with this stackoverflow.But this never happens together.

            Thank for interesting this issue.

            Maybe this is some race condition when eap 6.1 start since new eap 6.1 have concurrent deployment if i understand it well.

            • 3. Re: camel WARN java.lang.StackOverflowError
              Keith Babo Master

              Understood on your reasons not to share the real application.  Unfortunately, it's very hard to diagnose this type of issue without some form of reproducer.  One option is to try and create a smaller, dummy version of the application which targets a specific piece which might be causing trouble.  The fact that both subsystem initialization and deployment can happen in parallel could be causing issues here.  It's possible that the EJB initializes before the SY reference wiring is completely setup.  It's also possible that the consumer app is invoking the providing app before it's fully initialized.  This is all just speculation though.

               

              Have you tried packaging the applications in an EAR and using deployment ordering there?  You could also try defining a dependency from the consuming application to the providing application.  Documentation for both approaches can be found in the AS docs.

              • 4. Re: camel WARN java.lang.StackOverflowError
                Lukasz Sroka Newbie

                Thanks,

                I will try EAR and also try to reproduce this on some dummy examples.
                If i discover something i'll let you know.