Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Monday, January 7, 2013

Out of Memory Error When Deploying From Eclipse


While trying to deploy OSB changes from Eclipse to Weblogic I was getting the following error:

Runtime exception occurred during publish. The publish is aborted. Please report the bug with the stack trace. The stack can be found on the log and the Error Log view. java.lang.reflect.UndeclaredThrowableException






















The below error was reported in the Weblogic Server Log

<Jan 7, 2013 11:34:39 AM MST> <Error> <ALSB Console> <BEA-494002> <Internal error occured in OSBConsole : null
java.lang.reflect.InvocationTargetException
        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 com.bea.alsb.console.support.ConsoleSideMBeanInvocationHandler.__invoke(ConsoleSideMBeanInvocationHandler.java:113)
        Truncated. see log file for complete stacktrace
Caused By: java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2786)


The fix for this problem was very straight forward.  I just had to increase the max java heap space that was available to the Weblogic server.   This was done by setting the USER_MEM_ARGS environmental variable and restarting Weblogic.   Weblogic Service will use the memory settings in this variable when it is starting up. 

export USER_MEM_ARGS="-Xms256m -Xmx1024m -XX:CompileThreshold=8000 -XX:PermSize=256m  -XX:MaxPermSize=1024m"

-Xms -> Minimum Java Heap Size
-Xmx -> Maximum Java Heap Size
-XX:PermSize -> Minimum PermGen Size
-XX:MaxPermSize -> Maximum PermGen Size

Friday, December 28, 2012

Creating a JCA Database Adapter in JDeveloper


Below is an outline of the steps needed to create a JCA Database Adapter in JDeveloper.  Specifically they focus on how to create a JCA Database Adapter that can be imported into OSB.  If you are creating a database adapter for an existing SOA project then you can start on step 7.

1.  Open JDeveloper
2.  Create a new Generic Application


3.  Enter a name  for the Application.  You can reuse this same application to create any JCA Adapters in the future so name it something generic.  For example “Connections”
4.  Create a SOA Project


5.  Create an Empty Composite


6.   Drag the Database Adapter component from the Component Palette into the External References swim lane.
7.   A wizard will pop up which will guide you through creating the JCA Database Adapter.  There are 11 steps in this wizard. 
                a.  Fill in the Service name and then select Next (Step 2).
                b. Select the appropriate connection.  It will automatically fill in the JNDI Name. (Step 3) 


    c.  Select all of the Operation Types you want.  For this example, we will be able to Insert and Select from a table (Step 4).


    d.  Import all of the tables that you want to operate on.  You can import parent/child tables.  In this example, we only have one table (Step 5).


 e.  Define the primary keys (Step 6)


f.   If you have selected multiple tables.  Define the relationships between the tables. (Step 7)
g.  Exclude any attributes that you do not want to have access to.  (Step 8)


h.  If you only want to look at a subset of data from the table(s), then you can write a query to narrow down the data you will see. (Step 9)


i.  Define Advanced Options.  For most cases you can keep all of the defaults. (Step 10)


j. Click Finish.   This will create all of the files that you need to import this JCA Adapter into OSB.