Monday, June 23, 2008

WebLogic Server 10 : Deployment : OutOfMemory Error

I created a connection to WebLogic Server 10 in my JDeveloper 10.1.3. Now, I am using this connection to deploy a simple Web Application that contains a single JSP.

However, I keep hitting this bug frequently :-

[BasicOperation.deriveAppName():140] : appname established as: webapp1
weblogic.deploy.api.tools.deployer.DeployerException: Java heap space
at weblogic.deploy.api.tools.deployer.Jsr88Operation.postExecute(Jsr88Operation.java:563)
at weblogic.deploy.api.tools.deployer.DeployOperation.execute(DeployOperation.java:48)
at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:139)
at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88)
at weblogic.utils.compiler.Tool.run(Tool.java:158)
at weblogic.utils.compiler.Tool.run(Tool.java:115)
at weblogic.Deployer.run(Deployer.java:70)
at weblogic.Deployer.main(Deployer.java:54)
Caused by: java.lang.OutOfMemoryError: Java heap space
[ServerConnectionImpl.close():334] : Closing DM connection
[ServerConnectionImpl.close():354] : Unregistered all listeners
[ServerConnectionImpl.closeJMX():374] : Closed JMX connection
[ServerConnectionImpl.closeJMX():386] : Closed Runtime JMX connection
[ServerConnectionImpl.closeJMX():398] : Closed Edit JMX connection
**** weblogic.deploy returned with non-zero exit status: 1
**** weblogic.deploy returned with non-zero exit status: 1
Elapsed time for deployment: 46 seconds
#### Deployment incomplete. #### Jun 20, 2008 5:53:41 PM


The error clearly tells that the Java process used for the deployment is out of memory & is unable to deploy the application.

I have to increase the heap size of the java process that is used to deploy the application in JDeveloper.

I looked at the deployment profile for my application & noticed this command for WebLogic 9.x :-

${java} ${jvm.max.heap.size}
-classpath ${weblogic.jar} weblogic.Deployer
-adminurl t3://${hostname}:${port}
-user ${username} -password ${password}
-debug -verbose -deploy -upload
-source ${ear.file} -name ${j2ee.app.name}


However, at the time of deployment, I noticed that the heap size was not used for the Java process :-

javaw.exe -classpath weblogic.jar weblogic.Deployer -adminurl t3://localhost:7001 -user weblogic -password **** -debug -verbose -deploy -upload -source webapp1.ear -name webapp1

weblogic.Deployer invoked with options: -adminurl t3://localhost:7001 -user weblogic -debug -verbose -deploy -upload -source webapp1.ear -name webapp1


Hence, I hardcoded the heap size in the command in the Deployment Settings like this :-

${java} -Xms256m -Xmx512m
-classpath ${weblogic.jar} weblogic.Deployer
-adminurl t3://${hostname}:${port}
-user ${username} -password ${password}
-debug -verbose -deploy -upload
-source ${ear.file} -name ${j2ee.app.name}


At the time of depoyment, I noticed that the heap size as now being used correctly :-

javaw.exe -Xms256m -Xmx512m -classpath weblogic.jar weblogic.Deployer -adminurl t3://localhost:7001 -user weblogic -password **** -debug -verbose -deploy -upload -source webapp1.ear -name webapp1

weblogic.Deployer invoked with options: -adminurl t3://localhost:7001 -user weblogic -debug -verbose -deploy -upload -source webapp1.ear -name webapp1

After making this change, I was able to get a clean deployment from my JDeveloper 10.1.3.

.
.
.
[BasicOperation.execute():425] : Initiating deploy operation for app, webapp1, on targets:
Task 2 initiated: [Deployer:149026]deploy application webapp1 on examplesServer.
Task 2 completed: [Deployer:149026]deploy application webapp1 on examplesServer.
Target state: deploy completed on Server examplesServer
.
.
.
[ServerConnectionImpl.close():354] : Unregistered all listeners
[ServerConnectionImpl.closeJMX():374] : Closed JMX connection
[ServerConnectionImpl.closeJMX():386] : Closed Runtime JMX connection
[ServerConnectionImpl.closeJMX():398] : Closed Edit JMX connection
Elapsed time for deployment: 1 minute, 45 seconds
---- Deployment finished. ---- Jun 24, 2008 11:23:54 AM

No comments: