[JBoss ESB Development] - Performance Improvement Proposal: Cache result of HttpServle
by dward
HttpMessageComposer.populateMessage(Message, T) calls a helper method, getRequestInfo(HttpServletRequest) every time. This method will call several of the accessor methods of HttpServletRequest to populate the HttpRequest meta information to set in the ESB Message Properties.
One accessor method of HttpServletRequest stands out as being expensive: getLocalName(). This method under-the-hood calls java.net.InetAddress.getHostName()/getHostByAddr(), which accounted for 12.8% of the total testing time [1].
The proposed fix is to cache the request's localName. So change this:
requestInfo.setLocalName(request.getLocaleName());
to this:
requestInfo.setLocalName(getLocalName(request));
|
| private static final String getLocalName(HttpServletRequest request) {
| String localAddr = request.getLocalAddr();
| String localName = localAddr_to_localName.get(localAddr);
| if (localName == null) {
| synchronized (localAddr_to_localName) {
| localName = request.getLocalName();
| localAddr_to_localName.put(localAddr, localName);
| }
| }
| return localName;
| }
| private static final Map<String,String> localAddr_to_localName = new HashMap<String,String>();
JProfiler proved this hot spot completely fell off the map once the fix was applied.
[1]
Test Details:
- Web Service requests through new HttpGateway to a single-action chain calling the XsltAction.
- 50 client threads
- each Message size is <1k
Server Environment:
- Sun JDK 1.5.0_22
- Fedora 11 (Linux 2.6.30.9-99.fc11.i686.PAE)
- 4 gigs RAM, dual-core CPU
- JBoss ESB 4.7
Client Environment:
- Sun JDK 1.6.0_17
- Fedora 11 (Linux 2.6.30.9-99.fc11.i686.PAE)
- 2 gigs RAM, dual-core CPU
- soapUI 3.0.1
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269350#4269350
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269350
16 years, 1 month
[JBoss Build System Development] - NPE in maven-buildmagic-thirdparty-plugin
by jaikiran
On multiple occasions while build JBPAPP_5_0 branch, i have run into a NPE like this:
[java] [INFO] ------------------------------------------------------------------------
| [java] [ERROR] FATAL ERROR
| [java] [INFO] ------------------------------------------------------------------------
| [java] [INFO] null
| [java] [INFO] ------------------------------------------------------------------------
| [java] [INFO] Trace
| [java] java.lang.NullPointerException
| [java] at org.jboss.maven.plugins.thirdparty.Dependency.equals(Dependency.java:104)
| [java] at java.util.HashMap.put(HashMap.java:422)
| [java] at java.util.HashSet.add(HashSet.java:194)
| [java] at org.codehaus.plexus.component.configurator.converters.composite.CollectionConverter.fromConfiguration(CollectionConverter.java:181)
| [java] at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:247)
| [java] at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
| [java] at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56)
| [java] at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1282)
| [java] at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:661)
| [java] at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:429)
| [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
| [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
| [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
| [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
| [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
| [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
| [java] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
| [java] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
| [java] at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
| [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| [java] at java.lang.reflect.Method.invoke(Method.java:585)
| [java] at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
| [java] at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
| [java] at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
| [java] at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
| [java] [INFO] ------------------------------------------------------------------------
| [java] [INFO] Total time: 1 minute 39 seconds
| [java] [INFO] Finished at: Thu Dec 03 19:58:42 IST 2009
| [java] [INFO] Final Memory: 36M/93M
| [java] [INFO] ------------------------------------------------------------------------
| [java] Java Result: 1
I have seen this happening on the JBPAPP_5_0 branch only around 3-4 times. The only way i got past this was by deleting my "thirdparty" directory and letting it be recreated again.
I tried getting more informative logs, but i could only get this much. The -X option to maven did not generate anything more informative. Let me know if anything more is needed.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269344#4269344
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269344
16 years, 1 month
[JBoss AS Development] - Transaction Rolledback Exception
by john0135
Hi All,
Am trying to update around 25k records when I run the method in the end it throws an exception as follows and also rollbacks some data automatically.
Am using SQL 2008 and Java EJB please let me know if any one ever come across this situation.
the log follows:-
11:39:39,874 ERROR [LogInterceptor] TransactionRolledbackException in method: public abstract java.lang.String com.sma.scard
.enterprise.campus.student.ejb.Student.updateIdtech(java.lang.String) throws java.rmi.RemoteException,com.lynx.smartcard.
enterprise.global.exception.CardCdExistsException,com.sma.scard.enterprise.global.exception.CardAppException, causedBy:
java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.t
ransaction.arjunacore.inactive] The transaction is not active!
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commit(TransactionImple.java:225)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:501)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
at $Proxy125.updateIdtech(Unknown Source)
at com.lynx.smartcard.viewController.web.struts.campus.student.service.StudentDelegate.updateIdtech(StudentDelegate.j
ava:360)
at com.lynx.smartcard.viewController.web.struts.campus.student.action.StudentAction.updateIdtech(StudentAction.java:2
633)
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.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
11:39:40,577 INFO [STDOUT] null; nested exception is:
java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.intern
al.jta.transaction.arjunacore.inactive] The transaction is not active!; - nested throwable: (java.lang.IllegalStateException:
[com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive]
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269332#4269332
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269332
16 years, 1 month
[JBoss Microcontainer Development] - Re: Testing Deployers with new Reflect + ClassPool
by flavia.rainone@jboss.com
I bet I'm missing something simple.
Ales, I committed the adaptations I did for JBREFLECT-80 (the ones that are causing the errors I mentioned). Those adaptations are commented out with a TODO JBREFLECT-80. That should make it easier if you want to do any investigation to find out what is wrong. Just uncoment those and you will see the errors I am seeing.
Notice that there is a TODO JBREFLECT-80 on the pom.xml:
<move file="${project.build.testOutputDirectory}/org/jboss/test/classpool/support/excluded"
| todir="${project.build.directory}/test-excluded-classes/org/jboss/test/classpool/support"/>
| <!-- TODO JBREFLECT-80 -->
| <!-- <copy todir="${project.build.directory}/test-excluded-classes/org/jboss/test/classpool/support">
| <fileset dir="${project.build.testOutputDirectory}/org/jboss/test/classpool/support/excluded"/>
| </copy> -->
You need to replace the move task by the copy one, that is commented out.
I haven't added the jars to the test resources yet because first I want to have JBREFLECT-80 working. Adding the jars to test resources is next in my list :-).
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269328#4269328
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269328
16 years, 1 month