This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How to debug JAX-WS Web Service

 
Bartender
Posts: 1679
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having an issue where the web service I wrote can't find a file in the application directory.

My question is how do I debug the actual web service code?

I'm using MyEclipse which, for debugging, uses its own local application server. However, putting a break point on the code in the java class doesn't actually bring up the debugger so I'm clearly missing something.

Normally, putting a break point in a JSP or Servlet will bring up the debugging perspective.

Thanks in advance for any help or suggestions.

Mike
 
Ranch Hand
Posts: 44
Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mike,

I'm providing the instructions for the Webservice running in Weblogic Server.(As per my assumption!!!)
-----------------------------------------------------------------------------------------------------------------------
1 Select (in Eclipse)Run >> Open Debug Dialog from the main menu
2 Choose Remote Java Application and Enter the following
Project: you can choose the project here.
Host:localhost
Port: 8XXX
3.
C:\bea\user_projects\domains\<your domain name>\bin\setDomainEnv.cmd (Check the Path for the weblogic domain directory)
4 Find the following lines and the set the DEBUG_PORT to 8XXX
if "%DEBUG_PORT%"=="" (
set DEBUG_PORT=8XXX
)
5 Set the following after the set PRE_CLASSPATH line
set debugFlag=true

6 Make sure the following line exists
set JAVA_DEBUG=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n -Djava.compiler=NONE
7 Save and close the File.
8 Restart the Weblogic Application Server
9 Make sure the following line shows on the weblogic console log
Starting WLS with line:
C:\bea\JROCKI~2\bin\java -jrockit -Xdebug -Xnoagent
. configuration=system.properties -Dweblogic.ext.dir
Listening for transport dt_socket at address: 8XXX
10 On Eclipse Choose the following from the main menu
Run >> Debug History >> ApplicationName Remote Debugging
-------------------------------------------------------------------------------------------------------------------------------------------------
I hope this will help you.
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm having an issue where the web service I wrote can't find a file in the application directory.


How is the code trying to access the file?
 
Mike London
Bartender
Posts: 1679
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

The issue seems to be that MyEclipse's "Debug As" option for a Web Service seems like it's creating a directory that doesn't match the web service code's System.getProperty("user.dir").

I'm working to figure this out, but that seems to be the issue.

Thanks.

Mike
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using user.dir in a server application doesn't seem like such a good idea. I'd read the directory name from an init value somewhere (maybe web.xml if this is part of a web app).
 
Mike London
Bartender
Posts: 1679
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!