You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Pablo Bendersky <pb...@gmail.com> on 2007/05/10 21:31:19 UTC

Debug using SimpleHTTPServer

Hi,
I'm trying to setup a development environment with Axis2 where it's
easy for me to debug my services, but at the same time easy to deploy
them on a production server.
After looking around, I thought a good idea was to use Tomcat to
deploy and the embedded SimpleHTTPServer to debug.
So, I created a folder structure like this:
/src/
/server/
/server/conf/axis2.xml
/server/services/
/server/services/MyService
/server/services/MyService/META-INF

Then I configured eclipse to output the class files into
/server/services/MyService, and then wrote a starter class like this:
	public static void main(String[] args) {
        try {
			ConfigurationContext context = ConfigurationContextFactory.
			createConfigurationContextFromFileSystem("server", "server/conf/axis2.xml");
			SimpleHTTPServer server = new SimpleHTTPServer(context, 8080);
			server.start();
		} catch (AxisFault e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

The server starts ok, and I can get the WSDL file just fine. However,
when I try to run any webservice, it doesn't get to the skeleton file
(I'm using xmlbeans, BTW). If I zip the whole MyService folder and
deploy it on Tomcat as an aar file, the service works as expected.

I'm wondering if this is some classloader related issue, or anything.
Does anyone has any hint? Any better idea on how to accomplish an app
that is both easy to debug and easy to deploy at the same time?

Thanks in advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Debug using SimpleHTTPServer

Posted by Pablo Bendersky <pb...@gmail.com>.
Dennis,
Thanks, I'll try debugging directly in Tomcat.

On 5/10/07, Dennis Sosnoski <dm...@sosnoski.com> wrote:
> Hi Pablo,
>
> I generally stay with Tomcat for testing, hooking in for remote
> debugging from my IDE. To do this, you first have to start Tomcat with
> the debug transport enabled (using "catalina.sh jpda start" on
> Linux/Unix/Mac). You can then connect to the running server code from
> your IDE. Using Eclipse, you do this from your server code project by
> going to Run/Debug... Remote Java Application/New. This creates a debug
> configuration that matches the default for Tomcat running locally
> (localhost, port 8000). You just need to run this configuration and set
> a breakpoint in your server code in order to debug.
>
> On Windows it's a little more complex to configure Tomcat for Eclipse. I
> don't use Windows myself, but from looking at the slides I use in my
> training classes the default is for Tomcat to use a dt_shmem connector
> and address when run with catalina.bat. To change this, you need to set
> variables JPDA_TRANSPORT=dt_socket and JPDA_ADDRESS=8000. Some people
> were able do just add these lines directly to the start of their
> catalina.bat file, but for others that didn't seem to work (even though
> everyone was using the same Tomcat version, 4.1.32 as I remember) and
> they had to instead set these as environmental variables before running
> catalina.bat.
>
> I've also used local transport in the past for some of my own
> development, since that allows you to have both client and server code
> in the same project. For most purposes I find the remote debugging on
> Tomcat works best, though. Note that this can also be used with your
> production system (so that if something breaks in production you can
> hook in directly to try to find the problem). If you want to do this you
> should naturally make sure that access to port 8000 (or whatever number
> you choose to use) is restricted.
>
>   - Dennis
>
> --
> Dennis M. Sosnoski
> SOA and Web Services in Java
> Axis2 Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
> Pablo Bendersky wrote:
> > Hi,
> > I'm trying to setup a development environment with Axis2 where it's
> > easy for me to debug my services, but at the same time easy to deploy
> > them on a production server.
> > After looking around, I thought a good idea was to use Tomcat to
> > deploy and the embedded SimpleHTTPServer to debug.
> > So, I created a folder structure like this:
> > /src/
> > /server/
> > /server/conf/axis2.xml
> > /server/services/
> > /server/services/MyService
> > /server/services/MyService/META-INF
> >
> > Then I configured eclipse to output the class files into
> > /server/services/MyService, and then wrote a starter class like this:
> >     public static void main(String[] args) {
> >        try {
> >             ConfigurationContext context = ConfigurationContextFactory.
> >             createConfigurationContextFromFileSystem("server",
> > "server/conf/axis2.xml");
> >             SimpleHTTPServer server = new SimpleHTTPServer(context,
> > 8080);
> >             server.start();
> >         } catch (AxisFault e) {
> >             // TODO Auto-generated catch block
> >             e.printStackTrace();
> >         }
> >
> > The server starts ok, and I can get the WSDL file just fine. However,
> > when I try to run any webservice, it doesn't get to the skeleton file
> > (I'm using xmlbeans, BTW). If I zip the whole MyService folder and
> > deploy it on Tomcat as an aar file, the service works as expected.
> >
> > I'm wondering if this is some classloader related issue, or anything.
> > Does anyone has any hint? Any better idea on how to accomplish an app
> > that is both easy to debug and easy to deploy at the same time?
> >
> > Thanks in advance.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Debug using SimpleHTTPServer

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Hi Pablo,

I generally stay with Tomcat for testing, hooking in for remote 
debugging from my IDE. To do this, you first have to start Tomcat with 
the debug transport enabled (using "catalina.sh jpda start" on 
Linux/Unix/Mac). You can then connect to the running server code from 
your IDE. Using Eclipse, you do this from your server code project by 
going to Run/Debug... Remote Java Application/New. This creates a debug 
configuration that matches the default for Tomcat running locally 
(localhost, port 8000). You just need to run this configuration and set 
a breakpoint in your server code in order to debug.

On Windows it's a little more complex to configure Tomcat for Eclipse. I 
don't use Windows myself, but from looking at the slides I use in my 
training classes the default is for Tomcat to use a dt_shmem connector 
and address when run with catalina.bat. To change this, you need to set 
variables JPDA_TRANSPORT=dt_socket and JPDA_ADDRESS=8000. Some people 
were able do just add these lines directly to the start of their 
catalina.bat file, but for others that didn't seem to work (even though 
everyone was using the same Tomcat version, 4.1.32 as I remember) and 
they had to instead set these as environmental variables before running 
catalina.bat.

I've also used local transport in the past for some of my own 
development, since that allows you to have both client and server code 
in the same project. For most purposes I find the remote debugging on 
Tomcat works best, though. Note that this can also be used with your 
production system (so that if something breaks in production you can 
hook in directly to try to find the problem). If you want to do this you 
should naturally make sure that access to port 8000 (or whatever number 
you choose to use) is restricted.

  - Dennis

-- 
Dennis M. Sosnoski
SOA and Web Services in Java
Axis2 Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117


Pablo Bendersky wrote:
> Hi,
> I'm trying to setup a development environment with Axis2 where it's
> easy for me to debug my services, but at the same time easy to deploy
> them on a production server.
> After looking around, I thought a good idea was to use Tomcat to
> deploy and the embedded SimpleHTTPServer to debug.
> So, I created a folder structure like this:
> /src/
> /server/
> /server/conf/axis2.xml
> /server/services/
> /server/services/MyService
> /server/services/MyService/META-INF
>
> Then I configured eclipse to output the class files into
> /server/services/MyService, and then wrote a starter class like this:
>     public static void main(String[] args) {
>        try {
>             ConfigurationContext context = ConfigurationContextFactory.
>             createConfigurationContextFromFileSystem("server", 
> "server/conf/axis2.xml");
>             SimpleHTTPServer server = new SimpleHTTPServer(context, 
> 8080);
>             server.start();
>         } catch (AxisFault e) {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         }
>
> The server starts ok, and I can get the WSDL file just fine. However,
> when I try to run any webservice, it doesn't get to the skeleton file
> (I'm using xmlbeans, BTW). If I zip the whole MyService folder and
> deploy it on Tomcat as an aar file, the service works as expected.
>
> I'm wondering if this is some classloader related issue, or anything.
> Does anyone has any hint? Any better idea on how to accomplish an app
> that is both easy to debug and easy to deploy at the same time?
>
> Thanks in advance.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org