Thursday, March 17, 2011

Out Of Memory Errors of Oracle Application Server

There are various types of outof memory errors that occurs in the oracle application server.Based on the cause of the error, there are specific ways to fix it.


Root cause of the error and their fix is given below:

OutOfMemoryError: Java Heap Space
Cause: This error is hit when the part of the RAM allocated to JVM for carrying on the OAS task is not sufficient.
Solution: Increase the value of -Xmx. Oracle recommend to have the same value for -Xms and -Xmx.


OutOfMemoryError: PermGen space
Cause: This error occurs when there is not sufficient RAM left for native code i.e. the jar files required by the Application Server. This issue can hit after upgradation/patch on OAS also as more libraries are added which require more RAM.
Solution: Increase -XX:MaxPermSize=256m. On OAS, 256M is sufficient. You can also use -XX:PermSize along with -XX:MaxPermSize in case you want less than 256M RAM allocated to permanent generation during server startup.


OutOfMemoryError: unable to create new native thread
Cause: This error is thrown by the OS when there isn't enough RAM to create a new thread. It is beacuse of high value of -Xmx and -Xss.
Solution: For OAS, -Xss128K is sufficient. In case you are facing any issue you can incrase it to -Xss256K. If decreasing the value of -Xss is not helping then decrease the value of -Xmx.


java.lang.OutOfMemoryError: requested 1224368 bytes for Chunk::new. Out of swap space?
Cause: The cause of this error is same as above. The native objects are not getting enough RAM to use.
Solution: Decrease the value of -Xmx.

Friday, March 11, 2011

Could not instantiate ManagedConnectionFactory oracle.tip.adapter.jms.JmsManagedConnectionFactory

<AdapterFramework::Inbound> JNDI lookup of 'eis/Jms/DBConnect' failed due to: eis/Jms/DBConnect not found
<AdapterFramework::Inbound> Since unable to locate the JCA Resource Adapter deployed at 'eis/Jms/DBConnect', will then attempt to instantiate ManagedConnectionFactory oracle.tip.adapter.jms.JmsManagedConnectionFactory directly.
<AQ Adapter::Inbound> MessageReader_ctor: Initialized MessageReader for queue AQ_QUEUE, consumer = null)
<AdapterFramework::Inbound> Error while performing endpoint Activation: ORABPEL-12529
ManagedConnectionFactory problem.
Could not instantiate ManagedConnectionFactory oracle.tip.adapter.jms.JmsManagedConnectionFactory due to:

          Missing class: oracle.tip.adapter.jms.JmsManagedConnectionFactory

        Dependent class: oracle.tip.adapter.fw.wsdl.WSDLUtils
                 Loader: oracle.bpel.common:10.1.3
            Code-Source: /oracle/orasoa/bpel/lib/orabpel.jar
          Configuration: <code-source> in /oracle/orasoa/j2ee/oc4j_soa/config/server.xml

This load was initiated at esb-rt.root:0.0.0 using the Class.forName() method.

The missing class is not available from any code-source or loader in the system.
Please make sure the corresponding JCA Resource Adapter has been deployed.
 [Caused by:

          Missing class: oracle.tip.adapter.jms.JmsManagedConnectionFactory

        Dependent class: oracle.tip.adapter.fw.wsdl.WSDLUtils
                 Loader: oracle.bpel.common:10.1.3
            Code-Source: /oracle/orasoa/bpel/lib/orabpel.jar
          Configuration: <code-source> in /oracle/orasoa/j2ee/oc4j_soa/config/server.xml

This load was initiated at esb-rt.root:0.0.0 using the Class.forName() method.

The missing class is not available from any code-source or loader in the system.]
<AdapterFramework::Inbound> Adapter Framework instance: OraESB - endpointActivation for portType=Consume_Message_ptt, operation=Consume_Message
<AdapterFramework::Inbound> JNDI lookup of 'eis/Jms/DBConnect' failed due to: eis/Jms/DBConnect not found
<AdapterFramework::Inbound> Since unable to locate the JCA Resource Adapter deployed at 'eis/Jms/DBConnect', will then attempt to instantiate ManagedConnectionFactory oracle.tip.adapter.jms.JmsManagedConnectionFactory directly.
<AdapterFramework::Inbound> Error while performing endpoint Activation: ORABPEL-12529


Solution:

This error is a result of missing JMS adapter.
Verify from the EM console if "JmsAdapter" can be seen in the Cluster Topolgy -> <bpel container> -> Applications -> Standalone Resource Adapter. If it is missing then JMS Adapter is not properly deployed.
Now search in $ORACLE_HOME/j2ee/<bpel container>/config/oc4j-connectors.xml if there is an entry for JmsAdapter.
It will be something as shown below:
<connector name="JmsAdapter"
path="JmsAdapter.rar"> </connector>
In case there is no entry then go to the EM console and deploy the adapter by following the below steps:
Login to AS control as an admin user (oc4jadmin)
Click on your <bpel_container>
Click on Applications Tab
In the drop down box choose Standalone Resource Adapters
Click on the deploy button
Choose the required adapter rar file from $ORACLE_HOME/bpel/system/services/lib directory
In the next screen provide the "Resource Adapter Name" as "JmsAdapter".
Accept default values in screen 3 and click on the deploy button. After successful deployment, verify JmsAdapter under Standalone Resource Adapters.
In case of failure follow steps which are required when "JmsAdapter.rar" is found oc4j-connectors.xml.

In case there is an entry in oc4j-connectors.xml then the adapter was partially deployed and could not be completed due to some issue. Follow below steps in this case:
Navigate to $ORACLE_HOME/j2ee/<bpel_container>/connectors. Here "JmsAdapter" folder will be absent. Create a folder manually here with name "JmsAdapter".
Now inside this folder copy "JmsAdapter.rar" available at $ORACLE_HOME/bpel/system/services/lib.
Inside "JmsAdapter" folder create a subfolder with the same name i.e. "JmsAdapter". Now extract content of "JmsAdapter.rar" in the newly created "JmsAdapter" subfolder.
Now update the oc4j-ra.xml file and add the connection factory "eis/Jms/DBConnect". Remember to add all your custom connection factories.
Restart your SOA Server now and verify if JmsAdapter is now visible under the Standalone Resource Adapter list.

Tuesday, March 8, 2011

A System of name <SystemName> already exists.

I was getting below errors in my environment for two of the ESB's.

error code: 1071: 5
summary: A System of name <SystemName> already exists.

error code: 1047:5
Summary:  Parent of service "ServiceName" system "SystemName" doesn't exist

As a resolution for error 1 if I delete the system and then try to register the ESB then I hit error 2 and viceversa.
Initially my Oracle Application Server SOA Suite was 10.1.3.3.18 then I migrated it to 10.1.3.5 to resolve this issue. But the issue was intact even after upgradation of the server. I tried a lot of ways to resolve this issue and finally hit the jackpot with two of the below solutions
1> In your ESB project folder, remove all the files other than .esb, .jpr and .esbsvc. Now try registering your ESB. It will get register now. In my case both the problematic ESB's got registered successfully.
2>Create the same ESB "AS IS" again from the scratch and try registering it. It will get register now.

In case you have any other way to resolve this issue then do share it with me.

Friday, March 4, 2011

Oracle Service Registry 10g Registry Control and Business Service Registry Control is unaccessible on Oracle SOA Suite 10.1.3.5.

This is a bug which is fixed after applying oracle patch no. 9216686. For more detail on this bug refer oracle metalink document id 988084.1.