如何使用WebLogic 10.3调试Java EE应用程序 [英] How to debug Java EE application using WebLogic 10.3

查看:135
本文介绍了如何使用WebLogic 10.3调试Java EE应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WebLogic 10.3与Java EE应用程序。任何人都可以告诉我如何调试此应用程序?

解决方案

我认为其他答案有点错误。对于Windows,如果您将一个名为 debugFlag 的环境变量设置为true或在solaris / unix中执行相同的操作

  debugFlag = true 
export debugFlag
DEBUG_PORT = 8453
export DEBUG_PORT

,然后将要调用 setDomainEnv.sh setDomainEnv.cmd 通过其他脚本启动WLS。他们寻找 debugFlag DEBUG_PORT ,只要生产标志未设置,它将接收来自调试脚本的正确参数( -Xdebug -Xnoagent -Xrunjdwp:transport = dt_socket,address =%DEBUG_PORT%,server = y,suspend = n -Djava.compiler = NONE )。



你不应该是黑客这些脚本。这将使部署和维护变得更加困难,所以 setDomainEnv 脚本的整个目的是使整个集群和整个环境中使用和维护正确的默认值。注意,如果您使用的是Oracle weblogic maven插件,则目标 wls:deploy wls:start-server 然后在启动时选择这些环境设置,因为它们调用了引擎盖下的命令,然后它们首先调用 setDomainEnv



截至目前,如果您使用eclipse并设置了Oracle WebLogicServer,则maven插件将不会附加到当您发出一个 mvn:deploy 时,它将进入调试模式,您可以以调试模式重新启动(愚蠢),或者创建一个Run ==> Debug ==> DebugConfigurations ==> RemoteJavaApplication'连接类型为'standard(socket attach)',主机'localhost'(或远程服务器)和一个端口(默认为'8453')。然后你可以执行 Run ==>调试配置==>本地服务器附加


I am using WebLogic 10.3 with a Java EE application. Can anyone please tell me how to debug this application?

解决方案

I think the other answers are somewhat wrong. For windows, if you setup an environment variable called debugFlag to be true or in solaris/unix do the same

debugFlag=true
export debugFlag
DEBUG_PORT=8453
export DEBUG_PORT

, then setDomainEnv.sh or setDomainEnv.cmd are going to be called to start WLS by the other scripts. They look for the debugFlag and DEBUG_PORT, as long as the "production" flag is not set it will pick up the right parameters from the script for debugging (-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n -Djava.compiler=NONE).

YOU SHOULD NOT BE HACKING THESE SCRIPTS. It's going to make deployment and maintenance hard, the entire purpose of the setDomainEnv script is so that the right defaults are used and maintained across the cluster and throughout the entire environment. They are poorly documented I admit.

Note, if you are using the Oracle weblogic maven plugin, the target wls:deploy or wls:start-server will then pick up those environment settings when starting because they call the commands under the hood, and those in turn first call setDomainEnv.

As of right now, if you are using eclipse and have set up a Oracle WebLogicServer, the maven plugin will not attach to it into debug mode when you issue a mvn:deploy, you can either restart it in debug mode (silly), or create a 'Run ==> Debug ==> DebugConfigurations ==> RemoteJavaApplication' with a connection type of 'standard (socket attach)', a host of 'localhost' (or the remote server) and a port (default for me is '8453'). You can then do Run ==> Debug Configurations ==> Local Server Attach.

这篇关于如何使用WebLogic 10.3调试Java EE应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆