13 Replies Latest reply on Aug 7, 2009 5:09 PM by khaliqgaffar

    Java Heap Space Error when running cxf based service provider

    khaliqgaffar

      Hello,

      As defined in cheat sheets created a sample cxf based web service provider. When i try to run the web service i get the following error . I have attached eip_diagram as camel export file.

       

      Please let me know how this issue can be sorted. So that we can continue with evaluation process.

       

      Thanks,

      Khaliq

       

       

      current Working directory is D:\Apps\fuse\fuse-integration-designer-1.2.1\workspace\FuseJMSProject

              1. class com.fusesource.tools.eip.run.debugger.scaffolded.CamelLauncher PARAMS => debug=false, run=true, debugPort=3132, eventPort=3133, contextFileName=D:/Installs/IONA/Eclipse3.4.1/eclipse/runtime-New_configuration(1)/FuseOne/src/main/resources/META-INF/spring/wiretap-camel.xml #####

              2. debug=false, debugPort=3132, eventPort=3133, contextFileName=file:/C:/DOCUME1/s726580/LOCALS1/Temp/camel-configuration-45638.xml #####

      log4j:WARN No appenders could be found for logger (org.springframework.context.support.FileSystemXmlApplicationContext).

      log4j:WARN Please initialize the log4j system properly.

       

      INFO: No cxf.xml configuration file detected, relying on defaults.

      04-Aug-2009 14:38:04 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources

      INFO: No cxf.xml configuration file detected, relying on defaults.

      04-Aug-2009 14:38:07 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources

      INFO: No cxf.xml configuration file detected, relying on defaults.

      04-Aug-2009 14:38:13 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources

      INFO: No cxf.xml configuration file detected, relying on defaults.

      04-Aug-2009 14:38:22 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources

      INFO: No cxf.xml configuration file detected, relying on defaults.

      java.lang.OutOfMemoryError: Java heap space

           at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)

           at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:393)

           at java.lang.StringBuffer.append(StringBuffer.java:225)

           at java.io.StringWriter.write(StringWriter.java:90)

           at java.io.PrintWriter.write(PrintWriter.java:384)

           at java.io.PrintWriter.write(PrintWriter.java:401)

           at java.io.PrintWriter.print(PrintWriter.java:532)

           at java.io.PrintWriter.println(PrintWriter.java:669)

           at java.lang.Throwable.printStackTrace(Throwable.java:513)

           at org.springframework.beans.factory.BeanCreationException.printStackTrace(BeanCreationException.java:175)

           at java.util.logging.SimpleFormatter.format(SimpleFormatter.java:72)

           at java.util.logging.StreamHandler.publish(StreamHandler.java:179)

           at java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:88)

           at java.util.logging.Logger.log(Logger.java:452)

           at org.apache.cxf.common.logging.LogUtils.doLog(LogUtils.java:345)

           at org.apache.cxf.common.logging.LogUtils.log(LogUtils.java:252)

           at org.apache.cxf.bus.spring.SpringBusFactory.createApplicationContext(SpringBusFactory.java:104)

           at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:93)

           at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:86)

           at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:64)

           at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:53)

           at org.apache.camel.component.cxf.CxfConsumer.(CxfConsumer.java:52)

           at org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint.java:97)

           at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:62)

           at org.apache.camel.Route.getServicesForRoute(Route.java:74)

           at org.apache.camel.impl.DefaultCamelContext.startRoutes(DefaultCamelContext.java:692)

           at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:611)

           at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:95)

           at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:114)

           at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:326)

           at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)

           at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)

        • 1. Re: Java Heap Space Error when running cxf based service provider
          socallag

          Hi Khaliq,

           

          The camel file attached contains unresolved dependency on the bean id1 so we are unable to load this into the FID.

          Can you provide the spring bean xml files for the unresolved bean references.

           

          Regards,

           

          Seán.

          • 2. Re: Java Heap Space Error when running cxf based service provider
            khaliqgaffar

            Hi Sean,

             

            As requested by you i have attached spring bean xml file .

             

            Regards,

            Khaliq

            • 3. Re: Java Heap Space Error when running cxf based service provider
              khaliqgaffar

              Hi Sean,

               

              Also Attaching other files which you might require to load the file.Please remove the below beans from the bean xml file which had provided earlier.

               

                    

               

              Regards,

              Khaliq

              • 4. Re: Java Heap Space Error when running cxf based service provider
                socallag

                Hi Khaliq,

                 

                I'm still having problems importing the files into the FID, perhaps you can zip up the project and send it on.

                 

                Regards,

                 

                Seán.

                • 5. Re: Java Heap Space Error when running cxf based service provider
                  khaliqgaffar

                  Hi senoc,

                   

                  PFA,zipped version of entire project.

                   

                  Regards,

                  Khaliq

                  • 6. Re: Java Heap Space Error when running cxf based service provider
                    socallag

                    Hi Khaliq,

                     

                    I'm running your project and seeing the expected output when running the configuration:

                     

                    current Working directory is C:\FUSE_ISSUES\forum1093\FuseJMSProject

                            1. class com.fusesource.tools.eip.run.debugger.scaffolded.CamelLauncher PARAMS => debug=false, run=true, debugPort=1049, eventPort=1050, contextFileName=D:/Installs/IONA/Eclipse3.4.1/eclipse/runtime-New_configuration(1)/FuseOne/src/main/resources/META-INF/spring/wiretap-camel.xml #####

                            2. debug=false, debugPort=1049, eventPort=1050, contextFileName=file:/C:/DOCUME1/seanoc/LOCALS1/Temp/camel-configuration-700612765397294780.xml #####

                    log4j:WARN No appenders could be found for logger (org.springframework.context.support.FileSystemXmlApplicationContext).

                    log4j:WARN Please initialize the log4j system properly.

                    05-Aug-2009 14:45:00 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources

                    INFO: No cxf.xml configuration file detected, relying on defaults.

                    05-Aug-2009 14:45:02 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass

                    INFO: Creating Service ServiceImplClass from class com.CXF.ServiceImplClass

                    05-Aug-2009 14:45:02 org.apache.cxf.endpoint.ServerImpl initDestination

                    INFO: Setting the server's publish address to be http://localhost:9009/CXFWS

                    05-Aug-2009 14:45:02 org.mortbay.log.Slf4jLog info

                    INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog

                    05-Aug-2009 14:45:02 org.mortbay.log.Slf4jLog info

                    INFO: jetty-6.1.18

                    05-Aug-2009 14:45:02 org.mortbay.log.Slf4jLog info

                    INFO: Started SelectChannelConnector@0.0.0.0:9009

                    05-Aug-2009 14:45:02 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources

                    INFO: No cxf.xml configuration file detected, relying on defaults.

                    05-Aug-2009 14:45:02 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass

                    INFO: Creating Service ServiceImplClass from class com.CXF.ServiceImplClass

                    05-Aug-2009 14:45:02 org.apache.cxf.endpoint.ServerImpl initDestination

                    INFO: Setting the server's publish address to be http://localhost:9009/CXFWS

                     

                     

                    I run configuration based on the eip:

                     

                    file:/C:/FUSE_ISSUES/forum1093/FuseJMSProject/CXFDiagram.eip_diagram

                     

                    on the classpath I add the external jars from  FUSE MessageBroker 5.3.0.3 aqnd Service framework 2.2.2.0.I have not modified the EIP.

                     

                    How are you setting up the configuration to be run?

                     

                    Regards,

                     

                    Seán.

                    • 7. Re: Java Heap Space Error when running cxf based service provider
                      khaliqgaffar

                      Hi Seanoc,

                       

                      I did add the required lib to classpath of run configuration , but i still seem to have this issue.

                       

                      PFA, my launch configuration details

                      • 8. Re: Java Heap Space Error when running cxf based service provider
                        khaliqgaffar

                        Hi Senoc,

                         

                        I did fine tuning on run confiuration loaded those jar which are only required.But i still get the following errror. PFA, new optimized configuration jar.

                         

                        Regards,

                        Khaiq

                         

                        INFO: No cxf.xml configuration file detected, relying on defaults.

                        06-Aug-2009 08:33:30 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition

                        INFO: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder': replacing [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml] with [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml]

                        06-Aug-2009 08:33:30 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition

                        INFO: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder': replacing [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml] with [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml]

                        06-Aug-2009 08:33:30 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition

                        INFO: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider': replacing [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml] with [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml]

                        06-Aug-2009 08:33:30 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition

                        INFO: Overriding bean definition for bean 'org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory': replacing [Generic bean: class ; scope=singleton; abstract=false; lazyInit=true; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml] with [Generic bean: class ; scope=singleton; abstract=false; lazyInit=true; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml]

                        06-Aug-2009 08:33:31 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

                        INFO: Loading XML bean definitions from class path resource

                        06-Aug-2009 08:33:31 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory

                        INFO: Bean factory for application context : org.springframework.beans.factory.support.DefaultListableBeanFactory@12edf9a

                        06-Aug-2009 08:33:32 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons

                        INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12edf9a: defining beans ; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@17200b4

                        06-Aug-2009 08:33:36 org.springframework.context.support.AbstractApplicationContext prepareRefresh

                        INFO: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@2e84e1: display name ; startup date ; parent: org.springframework.context.support.FileSystemXmlApplicationContext@179c285

                        06-Aug-2009 08:33:37 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources

                        INFO: No cxf.xml configuration file detected, relying on defaults.

                        06-Aug-2009 08:33:39 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition

                        INFO: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder': replacing [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml] with [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml]

                        06-Aug-2009 08:33:40 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition

                        INFO: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder': replacing [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml] with [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml]

                        06-Aug-2009 08:33:40 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition

                        INFO: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider': replacing [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml] with [Generic bean: class ; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml]

                        06-Aug-2009 08:33:40 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition

                        INFO: Overriding bean definition for bean 'org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory': replacing [Generic bean: class ; scope=singleton; abstract=false; lazyInit=true; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml] with [Generic bean: class ; scope=singleton; abstract=false; lazyInit=true; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL jar:file:/D:/Apps/fuse/fuse-services-framework-2.2.2.0/lib/cxf-2.2.2.0-fuse.jar!/META-INF/cxf/cxf-extension-http.fixml]

                        06-Aug-2009 08:33:41 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

                        INFO: Loading XML bean definitions from class path resource

                        06-Aug-2009 08:33:41 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory

                        INFO: Bean factory for application context : org.springframework.beans.factory.support.DefaultListableBeanFactory@12f0cf1

                        06-Aug-2009 08:33:43 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons

                        INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12f0cf1: defining beans ; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@17200b4

                        java.lang.OutOfMemoryError: Java heap space

                             at sun.text.resources.DateFormatZoneData.getContents(DateFormatZoneData.java:299)

                             at sun.text.resources.DateFormatZoneData.loadLookup(DateFormatZoneData.java:144)

                             at sun.text.resources.DateFormatZoneData.getKeys(DateFormatZoneData.java:100)

                             at sun.text.resources.DateFormatZoneData.getKeys(DateFormatZoneData.java:105)

                             at java.text.DateFormatSymbols.loadZoneStrings(DateFormatSymbols.java:449)

                             at java.text.DateFormatSymbols.initializeData(DateFormatSymbols.java:489)

                             at java.text.DateFormatSymbols.(CxfConsumer.java:52)

                             at org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint.java:97)

                             at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:62)

                             at org.apache.camel.Route.getServicesForRoute(Route.java:74)

                             at org.apache.camel.impl.DefaultCamelContext.startRoutes(DefaultCamelContext.java:692)

                             at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:611)

                             at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:95)

                             at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:114)

                        • 9. Re: Java Heap Space Error when running cxf based service provider
                          khaliqgaffar

                          Any help on this regards would be highly appreciated.

                           

                          Regards,

                          Khaliq

                          • 10. Re: Java Heap Space Error when running cxf based service provider
                            socallag

                            Hi Khaliq,

                             

                            I modified my .classpath for the project slightly:

                             

                             

                             

                             

                            After that I exported your project into a brand new workspace. The clicked on the run configurations, after this step I was getting ClassNotFoundExceptiosn so using the add external jars option I added the jars from Services Framework 2.2.2.0 lib and Msssage Broker 5.3.0.3 lib.

                            This is all I did to get the service running.

                             

                            Regards,

                             

                            Seán.

                            • 11. Re: Java Heap Space Error when running cxf based service provider
                              khaliqgaffar

                              Hi seanoc,

                               

                              I had asked one of my peer developers to try the same sample as defined in cheat sheet.Unfortunately even he seems to be having the same issue as i had encountered.

                               

                              I am planning to try the sample on my personal mac book just wanted to see if this is a issue with windows.

                               

                              Regards,

                              Khaliq

                              • 12. Re: Java Heap Space Error when running cxf based service provider
                                mahesh_maheshs

                                Hi Khaliq,

                                 

                                I tried running /FuseJMSProject/CXFDiagram.eip_diagram and did not find the issues you reported.

                                 

                                You can try adding these 4 jars to the classpath in Run-configuration

                                 

                                From /lib directory

                                3- Stax.jar

                                4- Jaxb-impl.jar

                                 

                                Please let me know which version of FID are you using.

                                 

                                I used FID 1.2.1 to run this.

                                 

                                regards,

                                Mahesh

                                • 13. Re: Java Heap Space Error when running cxf based service provider
                                  khaliqgaffar

                                  Hi Mahesh,

                                   

                                  Thanks for your reply.

                                   

                                  This issue has been sorted out .As mentioned by you adding these 2 jar stax.jar and jaxb-impl.jar had solved the issue.

                                   

                                  I guess this should have also been mentioned in cheat sheet as well .

                                   

                                  Regards,

                                  Khaliq