Skip navigation.

Steve Button

Syndicate content The Buttso Blathers
Updated: 15 hours 40 min ago

NetBeans 8.1 Remote Debugging with WebLogic

Thu, 2015-07-23 06:39
Need to debug your application?  With NetBeans 8.1 (dev) and WebLogic it's very easy to do.

First start your WebLogic server in debug mode.  The startup scripts generated for a domain provide an option to start the server in debug mode. 

To run in debug mode, set the environment variable "debugFlag" to a value of "true" and  start the server.

$ export debugFlag="true"
$ ./startWebLogic.sh

 This launches the server with a command line such as that shown below, which sets the standard Java debug properties:
Starting WLS with line:
/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java -server -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE  -Xmx512m -Dweblogic.Name=myserver -Djava.security.policy=/tmp/dev_update2/wls12130/wlserver/server/lib/weblogic.policy  -Xverify:none -Djava.endorsed.dirs=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/endorsed:/tmp/dev_update2/wls12130/wlserver/../oracle_common/modules/endorsed  -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole... -Dwls.home=/tmp/dev_update2/wls12130/wlserver/server -Dweblogic.home=/tmp/dev_update2/wls12130/wlserver/server -Dweblogic.utils.cmm.lowertier.ServiceDisabled=true weblogic.Server
The console will display a message confirming the debug Java VM is using:
Listening for transport dt_socket at address: 8453

Now on the NetBeans side, create a new Server entry for your WebLogic instance using the new Remote Domain option:
 

Check the Server debug mode enabled option and specify the port (8453 by default):

 
Now specify the new server as the destination to use to run the application:

Now to debug your application, simply set a break point in your code and select the Debug option for the project:


 
This will build and deploy the application to the WebLogic remotely then open the Debugger in the IDE and connect it automatically to the WebLogic debug port. 

From here you can use all the standard debug facilities to step through your code, view stacks, instance data and so forth.

Debug away!




NetBeans 8.1 Remote Deployment for WebLogic

Tue, 2015-07-21 23:41
Stoked that NetBeans 8.1 will have support for deployment to remote WebLogic Server instances.

http://wiki.netbeans.org/NewAndNoteworthyNB81#Remote_WebLogic



#lovethistool

Deploying applications remotely with WebLogic REST Management Interface

Wed, 2015-04-08 19:20
WebLogic 12.1.3 provides a fully documented REST Management Interface that enables deployment and management operations to be performed using REST calls.

The table of contents from the documentation lists the set of operations available:
To use the REST Management Interface, it first must be enabled for a domain. This can be done from the WebLogic Console.

Domain > Configuration > General [Advanced] > Enable RESTful Management Services




To deploy an application to a remote server, the REST Management Interface provides the ability to upload an application archive and execute the deployment operation:
To perform this type of deployment operation a HTTP POST on the deployment URL is invoked specifying:
  1. The HTTP Header of multipart/form-data;
  2. The application archive is supplied as form field deployment;
  3. The deployment information specified using the form field model in which the application name, targets and other attributes are supplied;
Using curl this looks like the following:

$ curl \
--user weblogic:welcome1 \
-H X-Requested-By:TestForRest \
-H Accept:application/json \
-H Content-Type:multipart/form-data \
-F "model={
name: 'basicwebapp',
targets: [ 'AdminServer' ]
}" \
-F "deployment=@/tmp/basicwebapp.war" \
-X POST http://adc2101001.us.oracle.com:7001/management/wls/latest/deployments/application

When this REST call is made with curl, the application archive specified as @/tmp/basicwebapp.war is uploaded as a binary file using the form field deployment and the configuration information supplied in the model form parameter used to define and perform the deployment.

The response returned from the REST call contains a payload with the result of the operation that was performed.

{
"messages": [{
"message": "Deployed the application 'basicwebapp'.",
"severity": "SUCCESS"
}],
"links": [{
"rel": "job",
"uri": "http://adc2101001:7001/management/wls/latest/jobs/deployment/id/3"
}],
"item": {
"name": "ADTR-3",
"id": "3",
"type": "deployment",
"status": "completed",
"beginTime": 1428541581923,
"endTime": 1428541584150,
"targets": [{
"name": "AdminServer",
"type": "server",
"errors": [],
"status": "completed"
}],
"description": "[Deployer:149026]deploy application basicwebapp on AdminServer.",
"operation": "deploy",
"deploymentName": "basicwebapp"
}
}

Further information about the deployment resource can be obtained using a further REST call, which provides links to operations that can be performed on the application, URLs to access the application, context-paths for registered servlets, runtime data and other useful information.

$ curl \
--user weblogic:welcome1 \
-H Accept:application/json \
http://adc2101001:7001/management/wls/latest/deployments/application/id/basicwebapp

Which returns a response containing a payload with details of the deployment:

{
"links": [
{
"rel": "parent",
"uri": "http://adc2101001:7001/management/wls/latest/deployments/application"
},
{
"rel": "action",
"uri": "http://adc2101001:7001/management/wls/latest/deployments/application/id/basicwebapp/redeploy",
"title": "redeploy"
},
{
"rel": "action",
"uri": "http://adc2101001:7001/management/wls/latest/deployments/application/id/basicwebapp/update",
"title": "update"
},
{
"rel": "action",
"uri": "http://adc2101001:7001/management/wls/latest/deployments/application/id/basicwebapp/start",
"title": "start"
},
{
"rel": "action",
"uri": "http://adc2101001:7001/management/wls/latest/deployments/application/id/basicwebapp/stop",
"title": "stop"
},
{
"rel": "bindables",
"uri": "http://adc2101001:7001/management/wls/latest/deployments/application/id/basicwebapp/bindables"
}
],
"item": {
"name": "basicwebapp",
"state": "active",
"type": "application",
"displayName": "basicwebapp",
"targets": ["AdminServer"],
"planPath": "/scratch/sbutton/Oracle/Middleware/user_projects/domains/arq_domain/servers/AdminServer/upload/basicwebapp/plan/Plan.xml",
"urls": ["http://adc2101001:7001/basicwebapp"],
"openSessionsCurrentCount": 1,
"sessionsOpenedTotalCount": 1,
"servlets": [
{
"servletName": "JspServlet",
"contextPath": "/basicwebapp",
"aggregateMetrics": {
"executionTimeTotal": 0,
"invocationTotalCount": 0,
"reloadTotalCount": 0,
"executionTimeHigh": 0,
"executionTimeLow": 0
},
"servletMetrics": [{
"serverName": "AdminServer",
"executionTimeTotal": 0,
"invocationTotalCount": 0,
"reloadTotalCount": 0,
"executionTimeHigh": 0,
"executionTimeLow": 0
}]
},
{
"servletName": "Faces Servlet",
"contextPath": "/basicwebapp",
"aggregateMetrics": {
"executionTimeTotal": 22,
"invocationTotalCount": 1,
"reloadTotalCount": 1,
"executionTimeHigh": 22,
"executionTimeLow": 22
},
"servletMetrics": [{
"serverName": "AdminServer",
"executionTimeTotal": 22,
"invocationTotalCount": 1,
"reloadTotalCount": 1,
"executionTimeHigh": 22,
"executionTimeLow": 22
}]
},
{
"servletName": "FileServlet",
"contextPath": "/basicwebapp",
"aggregateMetrics": {
"executionTimeTotal": 0,
"invocationTotalCount": 0,
"reloadTotalCount": 0,
"executionTimeHigh": 0,
"executionTimeLow": 0
},
"servletMetrics": [{
"serverName": "AdminServer",
"executionTimeTotal": 0,
"invocationTotalCount": 0,
"reloadTotalCount": 0,
"executionTimeHigh": 0,
"executionTimeLow": 0
}]
}
],
"ejbs": [],
"deploymentPath": "servers/AdminServer/upload/basicwebapp/app/basicwebapp.war",
"applicationType": "war",
"health": {"state": "ok"}
}

The documentation provides extensive coverage of the many resources and entity types that can be reached via the REST Management Interface.