简体   繁体   English

如何调试服务器端错误?

[英]How do I debug server-side errors?

Our Java application is going through migration from a WAS 7 server to a WAS 8.5 server - and for some reason, even though our application shows as Deployed in our Admin Console, the application itself isn't coming up on our assigned URL.我们的 Java 应用程序正在从 WAS 7 服务器迁移到 WAS 8.5 服务器 - 出于某种原因,即使我们的应用程序在我们的管理控制台中显示为已部署,应用程序本身也不会出现在我们分配的 URL 上。

I've ruled out the possibility of a code-related problem by testing the application in my local server, so I know the problem is with some server settings - but, almost all of my experience in CS is in coding, and I don't know how to figure out where those settings have gone awry.我已经通过在我的本地服务器上测试应用程序排除了与代码相关的问题的可能性,所以我知道问题出在某些服务器设置上——但是,我在 CS 方面的几乎所有经验都在编码中,我不知道不知道如何找出这些设置哪里出错了。

What options do I have to debug my application's server-side issues?我有哪些选项可以调试我的应用程序的服务器端问题?

You don't specify what you mean by "coming up," so I'll start with the broad suggestions.您没有具体说明“提出来”是什么意思,所以我将从广泛的建议开始。

A couple things to sanity check:几件事情要检查:

  • Ensure the application has been deployed on the specific server you are trying to access it on.确保应用程序已部署在您尝试访问它的特定服务器上。 It's common to have multiple servers all in one cell controlled by one deployment manager, and applications can be deployed to only some of those servers.将多台服务器全部放在一个单元中并由一个部署管理器控制是很常见的,并且应用程序只能部署到这些服务器中的一部分。 In the admin console, under Servers -> WebSphere application servers you can find the server you expect it to be on and check Installed applications .在管理控制台中,在Servers -> WebSphere application servers下,您可以找到您希望它所在的服务器并检查Installed applications
  • Check to see if the application itself has started.检查应用程序本身是否已启动。 It's possible the server has been started, but not the application.有可能服务器已启动,但应用程序尚未启动。 In Applications -> WebSphere enterprise applications , look for the green arrow next to your application.Applications -> WebSphere enterprise applications中,查找应用程序旁边的绿色箭头。
  • If you're trying to access a servlet, make sure the context-root of your web module is set to what you expect.如果您尝试访问一个 servlet,请确保将您的 Web 模块的上下文根设置为您所期望的。 In the application's configuration page, it's in Context Root for Web Modules under Web Module Properties .在应用程序的配置页面中,它位于Web Module Properties下的Context Root for Web Modules中。
  • If all of those seem correct, or if the application is stopped and won't start, check the server logs in your profile's logs directory, especially the SystemOut.log and the ffdc folder.如果所有这些看起来都是正确的,或者应用程序已停止且无法启动,请检查配置文件logs目录中的服务器日志,尤其是 SystemOut.log 和 ffdc 文件夹。 It may be that an error is occuring when you go to access it, or when it is starting up.可能是你去访问的时候出错了,或者启动的时候出错了。 Those should appear there.那些应该出现在那里。
  • If your application uses EJBs at a version less than 3.1, the EJBDeploy tool must have been run against your application either before deployment, or as part of the deployment process.如果您的应用程序使用版本低于 3.1 的 EJB,那么 EJBDeploy 工具必须在部署之前或作为部署过程的一部分针对您的应用程序运行。 If you are expecting the latter to occur, ensure the EJBDeploy tool was installed alongside WebSphere on the target system.如果您希望出现后者,请确保 EJBDeploy 工具与 WebSphere 一起安装在目标系统上。

If all of that fails, you may way to break out the debugger (if that's allowed in your environment) and see if your code is even being reached.如果所有这些都失败了,您可能会中断调试器(如果您的环境允许这样做)并查看是否甚至可以访问您的代码。

  1. Check Server Logs: in WAS Console you can find the logs of your server.检查服务器日志:在 WAS 控制台中,您可以找到服务器的日志。

  2. Debug in local server.在本地服务器调试。 By deploying an ear in your local server, you can then start the server in loggin mode.通过在本地服务器中部署 ear,您可以在登录模式下启动服务器。 Then you shuld stop and restart your websphere aplication and it will be stoped in selected breakpoints.然后你应该停止并重新启动你的 websphere 应用程序,它将在选定的断点处停止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM