Showing posts with label osb11. Show all posts
Showing posts with label osb11. Show all posts

Friday, May 21, 2010

OSB: coherence and caching

this
http://www.oracle.com/technology/architect/enterprise_solution_cookbook/data_tier_caching_for_soa.html

makes a good reading just to get an idea of how to make a CacheService invoking Coherence. The service can be exposed with a LOCAL transport protocol to avoid marshalling/unmarshalling.

In a nutshell it says: you can cache either Service State (e.g. for a BPM the serialized state of a Process Instance) or Service Result (the result of a DB query).

Cache-aside means: 1) readFromCache 2) miss 3) retrieveFromDB 4) storeInCache
next time you read the same key, you have a hit.

This is very illuminating:

Oracle Coherence offers a Java API; a native service call from BPEL to Coherence was a preference over a standard web service interface. The performance overhead of invoking web service operations is several orders of magnitude larger than that of invoking native Java classes. That's because marshaling and un-marshaling XML, processing SOAP envelopes, etc. are expensive operations.

Note the use of


thread.setContextClassLoader(com.tangosol.net.NamedCache.class.getClassLoader());


to avoid creating a different cache per each classloader in the application! Well done!
(don't forget to set the classloader again to its previous value!)

OSB: performance monitoring

It's important to understand which JEE modules are involved in a request processing.
I am here hammering with 100 concurrent threads a simple Proxy Service, /OSBProject1/ProxyService1, which appears in the Web Applications list but as "Unprepared".

There are many wars involved: xbuslogging.war, xbuspublish.war, xbusrouting.war, xbustransform.war, but mainly it's httpTransport.war  who seems to be the entry point for each request.

httpTransport.war is deployed in a kernelEar (C:\bea11\Oracle_OSB11\lib\kernelEar), whose application name is XBus Kernel. This animal contains a HttpEndPointCreator, which probably is responsible for the dynamic creation of the /OSBProject1/ProxyService1 endpoint.



Web Applications (Filtered - More Columns Exist)



Context Root 
State  Source Information  Maximum Sessions on Any Server  Application  Servlets 

Active fmw-welcome.war 0 FMW Welcome Page Application (11.1.0.0.0) 3
/alsb-uddi Active com/bea/wli/sb/uddi/auto/UDDISubscriptionListenerImpl.war 0 ALSB Subscription Listener 4
/alsb/ws/_async Active bea_alsb_ws_async_response.war 0 WS Transport Async Applcation 9
/dms Active dms.war 0 DMS Application (11.1.1.1.0) 4
/httpTransport Active httpTransport.war 0 XBus Kernel 3
/inspection.wsil Active wsil.war 0 wsil-wls 4
/OSBProject1/ProxyService1 Unprepared httpTransport.war 0 XBus Kernel 4
/sbconsole Active webapp 1 ServiceBus_Console 14
/sbinspection.wsil Active wsil.war 0 ALSB WSIL 4
/sbresource Active sbresource.war 0 ALSB Resource 4
/sbtestservice Active sbTestFwk.war 0 ALSB Test Framework 4
/xbuslogging Active xbuslogging.war 0 ALSB Logging 6
/xbuspublish Active xbuspublish.war 0 ALSB Publish 6
/xbusrouting Active xbusrouting.war 0 ALSB Routing 6
/xbustransform Active xbustransform.war 0 ALSB Transform 6








OSB thread dump on XQuery parser

 I am logging $body during this Thread Dump.... interesting stuff... OSB internally uses Apache XMLBeans and Apache Piccolo Sax Parser

Also interesting that whenever XQuery wants to read a variable it calls

com/bea/wli/sb/context/MessageContextImpl.getVariableValue(MessageContextImpl.java:202)


I have put in BOLD the focal points.



            "[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'" id=18 idx=0x48 tid=928 prio=5 alive, native_blocked, daemon
         
                at org/apache/xmlbeans/impl/piccolo/util/CharStringConverter.hashKey(CharStringConverter.java:168)
         
                at org/apache/xmlbeans/impl/piccolo/util/CharStringConverter.convert(CharStringConverter.java:97)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.parseCdataLiteral(PiccoloLexer.java:3025)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.parseQuotedTagValue(PiccoloLexer.java:2936)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.parseAttributesNS(PiccoloLexer.java:1754)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.parseOpenTagNS(PiccoloLexer.java:1521)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.parseTagNS(PiccoloLexer.java:1362)
         
                at org/apache/xmlbeans/impl/piccolo/xml/PiccoloLexer.yylex(PiccoloLexer.java:4678)
         
                at org/apache/xmlbeans/impl/piccolo/xml/Piccolo.yylex(Piccolo.java:1290)
         
                at org/apache/xmlbeans/impl/piccolo/xml/Piccolo.yyparse(Piccolo.java:1400)
         
                at org/apache/xmlbeans/impl/piccolo/xml/Piccolo.parse(Piccolo.java:714)
         
                at org/apache/xmlbeans/impl/store/Locale$SaxLoader.load(Locale.java:3456)
         
                at org/apache/xmlbeans/impl/store/Locale.parseToXmlObject(Locale.java:1278)
         
                at org/apache/xmlbeans/impl/store/Locale.parseToXmlObject(Locale.java:1252)
         
                at org/apache/xmlbeans/impl/schema/SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345)
         
                at org/apache/xmlbeans/XmlObject$Factory.parse(XmlObject.java:747)
         
                at com/bea/wli/sb/sources/XmlObjectSource.getInstance(XmlObjectSource.java:203)
         
                at com/bea/wli/sb/sources/XmlObjectTransformer.getXmlObjectSource(XmlObjectTransformer.java:199)
         
                at com/bea/wli/sb/sources/XmlObjectTransformer.transform(XmlObjectTransformer.java:111)
         
                at com/bea/wli/sb/sources/MetaTransformer.doTransform(MetaTransformer.java:138)
         
                at com/bea/wli/sb/sources/MetaTransformer.transform(MetaTransformer.java:89)
         
                at com/bea/wli/sb/pipeline/PipelineContextImpl$LazyInitTransformer.transform(PipelineContextImpl.java:1426)
         
                at com/bea/wli/sb/context/SOAPMessageImpl.parseCheckEnvelope(SOAPMessageImpl.java:1143)
         
                at com/bea/wli/sb/context/SOAPMessageImpl.unpack(SOAPMessageImpl.java:705)
         
                at com/bea/wli/sb/context/SOAPMessageImpl.getBody(SOAPMessageImpl.java:248)
         
                at com/bea/wli/sb/context/BodyVariable.getTypedValue(BodyVariable.java:106)
         
                at com/bea/wli/sb/context/BodyVariable.getTypedValue(BodyVariable.java:25)
         
                at com/bea/wli/sb/context/SystemVariable.getValue(SystemVariable.java:49)
         
                at com/bea/wli/sb/context/MessageContextImpl.getVariableValue(MessageContextImpl.java:202)
         
                at com/bea/wli/sb/stages/expressions/xquery/XQueryExprExecutor.getVariables(XQueryExprExecutor.java:182)
         
                at com/bea/wli/sb/stages/expressions/xquery/XQueryExprExecutor.executeJavaObject(XQueryExprExecutor.java:129)
         
                at stages/logging/runtime/LogRuntimeStep.processMessage(LogRuntimeStep.java:109)
         
                at com/bea/wli/sb/pipeline/debug/DebuggerRuntimeStep.processMessage(DebuggerRuntimeStep.java:74)
         
                at com/bea/wli/sb/stages/StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
         
                at com/bea/wli/sb/pipeline/PipelineStage.processMessage(PipelineStage.java:84)
         
                at com/bea/wli/sb/pipeline/PipelineContextImpl.execute(PipelineContextImpl.java:922)
         
                at com/bea/wli/sb/pipeline/Pipeline.processMessage(Pipeline.java:141)
         
                at com/bea/wli/sb/pipeline/PipelineContextImpl.execute(PipelineContextImpl.java:922)
         
                at com/bea/wli/sb/pipeline/PipelineNode.doRequest(PipelineNode.java:55)
         
                at com/bea/wli/sb/pipeline/Node.processMessage(Node.java:67)
         
                at com/bea/wli/sb/pipeline/PipelineContextImpl.execute(PipelineContextImpl.java:922)
         
                at com/bea/wli/sb/pipeline/Router.processMessage(Router.java:214)
         
                at com/bea/wli/sb/pipeline/MessageProcessor.processRequest(MessageProcessor.java:99)
         
                at com/bea/wli/sb/pipeline/RouterManager$1.run(RouterManager.java:593)
         
                at com/bea/wli/sb/pipeline/RouterManager$1.run(RouterManager.java:591)
         
                at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         
                at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:147)
         
                at com/bea/wli/sb/security/WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
         
                at com/bea/wli/sb/pipeline/RouterManager.processMessage(RouterManager.java:590)
         
                at com/bea/wli/sb/transports/TransportManagerImpl.receiveMessage(TransportManagerImpl.java:375)
         
                at com/bea/wli/sb/transports/http/generic/RequestHelperBase$1.run(RequestHelperBase.java:154)
         
                at com/bea/wli/sb/transports/http/generic/RequestHelperBase$1.run(RequestHelperBase.java:152)
         
                at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         
                at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:147)
         
                at com/bea/wli/sb/transports/http/generic/RequestHelperBase.securedInvoke(RequestHelperBase.java:151)
         
                at com/bea/wli/sb/transports/http/generic/RequestHelperBase.service(RequestHelperBase.java:107)
         
                at com/bea/wli/sb/transports/http/wls/HttpTransportServlet.service(HttpTransportServlet.java:127)
         
                at weblogic/servlet/FutureResponseServlet.service(FutureResponseServlet.java:24)
         
                at javax/servlet/http/HttpServlet.service(HttpServlet.java:820)
         
                at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         
                at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         
                at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)
         
                at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:183)
         
                at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3686)
         
                at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         
                at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         
                at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:121)
         
                at weblogic/servlet/internal/WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         
                at weblogic/servlet/internal/WebAppServletContext.execute(WebAppServletContext.java:2174)
         
                at weblogic/servlet/internal/ServletRequestImpl.run(ServletRequestImpl.java:1446)
         
                at weblogic/work/ExecuteThread.execute(ExecuteThread.java:201)
         
                at weblogic/work/ExecuteThread.run(ExecuteThread.java:173)
         
                at jrockit/vm/RNI.c2java(IIIII)V(Native Method)

Thursday, May 20, 2010

WebLogic 11g, OSB11 and Web Service client

Glory to Oracle, they have introduced Eclipse 3.5.2, wow!

AT LAST Oracle introduced a wizard to generate a Java Web Service Client without having to struggle for zip and jar files and classpaths for hours... Long Live Oracle!

Do New, Other, and you have 2 options:
Web Service Client and
WebLogic Web Service Client

With Web Service Client
you have the option to
Monitor SOAP traffic and
Customize namespace to Java packages mapping (cool!)



and here is the code you should use


HelloWorldSOAP12BindingQSServiceLocator locator = new HelloWorldSOAP12BindingQSServiceLocator();
HelloWorldPortType pt = locator.getHelloWorldSOAP12BindingQSPort();
pt.helloWorld("vaffanculo");