Can't get debug to work

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't get debug to work

John H

Hi all.  I’m running DWR 2.0.10 with WebSphere 7 and debug isn’t working for me.  It worked previously, but that was when I first set up DWR several years and was likely version 2.0.6.  I haven’t touched the configuration much since.  Hopefully I’m just missing something simple.  This is in web.xml:

 

               <servlet>

                              <servlet-name>dwr-invoker</servlet-name>

                              <display-name>DWR Servlet</display-name>

                              <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>

                              <init-param>

                                             <param-name>debug</param-name>

                                             <param-value>true</param-value>

                              </init-param>

                              <init-param>

                                             <param-name>crossDomainSessionSecurity</param-name>

                                             <param-value>false</param-value>

                              </init-param>

               </servlet>

 

               <servlet-mapping>

                              <servlet-name>MyServlet</servlet-name>

                              <url-pattern>/MyServlet</url-pattern>

               </servlet-mapping>

               <servlet-mapping>

                              <servlet-name>dwr-invoker</servlet-name>

                              <url-pattern>/dwr/*</url-pattern>

               </servlet-mapping>

 

And this is in dwr.xml:

 

    <create creator="new" javascript="MyServlet">

      <param name="class" value="MyServlet"/>

    </create>

 

 

I tried adding <param name=”debug” value=”true”> to the servlet descriptor in dwr.xml, but that didn’t help.  I don’t think the crossDomainSessionSecurity setting has any bearing, but I tried flipping it to true also just in case. 

 

This is what I’m getting in the log when I try https://myworkstation/servlet/dwr/MyServlet/

 

[2/26/14 18:06:30:662 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info DWR Version 2.0.10 starting.

[2/26/14 18:06:30:663 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info - Servlet Engine: IBM WebSphere Application Server/7.0

[2/26/14 18:06:30:665 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info - Java Version:   1.6.0

[2/26/14 18:06:30:666 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info - Java Vendor:    IBM Corporation

[2/26/14 18:06:30:865 PST] 0000002f servlet       I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [MomGroupEAR] [/servlet] [dwr-invoker]: Initialization successful.

[2/26/14 18:06:30:868 PST] 0000002f NotFoundHandl W org.directwebremoting.util.CommonsLoggingOutput warn Page not found. pathInfo='/MyServlet/' requestUrl='/servlet/dwr/QuickSearch/'

[2/26/14 18:06:30:869 PST] 0000002f NotFoundHandl W org.directwebremoting.util.CommonsLoggingOutput warn In debug/test mode try viewing /[WEB-APP]/dwr/

 

And this is what I get in the browser:

 

Error 404: SRVE0295E: Error reported: 404

 

When I try https://myworkstation/servlet/MyServlet/dwr/, I get nothing logged, and this in the browser:

 

Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /MyServlet/dwr/

 

All the normal production aspects of DWR work fine.  Any ideas?

 

Thanks,

John

Reply | Threaded
Open this post in threaded view
|

Re: Can't get debug to work

david@butterdev.com
I am not sure what you are doing here but the test page is produced by the DWR servlet at /dwr/.


On 02/26/2014 07:30 PM, John Hester wrote:

Hi all.  I’m running DWR 2.0.10 with WebSphere 7 and debug isn’t working for me.  It worked previously, but that was when I first set up DWR several years and was likely version 2.0.6.  I haven’t touched the configuration much since.  Hopefully I’m just missing something simple.  This is in web.xml:

 

               <servlet>

                              <servlet-name>dwr-invoker</servlet-name>

                              <display-name>DWR Servlet</display-name>

                              <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>

                              <init-param>

                                             <param-name>debug</param-name>

                                             <param-value>true</param-value>

                              </init-param>

                              <init-param>

                                             <param-name>crossDomainSessionSecurity</param-name>

                                             <param-value>false</param-value>

                              </init-param>

               </servlet>

 

               <servlet-mapping>

                              <servlet-name>MyServlet</servlet-name>

                              <url-pattern>/MyServlet</url-pattern>

               </servlet-mapping>

               <servlet-mapping>

                              <servlet-name>dwr-invoker</servlet-name>

                              <url-pattern>/dwr/*</url-pattern>

               </servlet-mapping>

 

And this is in dwr.xml:

 

    <create creator="new" javascript="MyServlet">

      <param name="class" value="MyServlet"/>

    </create>

 

 

I tried adding <param name=”debug” value=”true”> to the servlet descriptor in dwr.xml, but that didn’t help.  I don’t think the crossDomainSessionSecurity setting has any bearing, but I tried flipping it to true also just in case. 

 

This is what I’m getting in the log when I try https://myworkstation/servlet/dwr/MyServlet/

 

[2/26/14 18:06:30:662 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info DWR Version 2.0.10 starting.

[2/26/14 18:06:30:663 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info - Servlet Engine: IBM WebSphere Application Server/7.0

[2/26/14 18:06:30:665 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info - Java Version:   1.6.0

[2/26/14 18:06:30:666 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info - Java Vendor:    IBM Corporation

[2/26/14 18:06:30:865 PST] 0000002f servlet       I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [MomGroupEAR] [/servlet] [dwr-invoker]: Initialization successful.

[2/26/14 18:06:30:868 PST] 0000002f NotFoundHandl W org.directwebremoting.util.CommonsLoggingOutput warn Page not found. pathInfo='/MyServlet/' requestUrl='/servlet/dwr/QuickSearch/'

[2/26/14 18:06:30:869 PST] 0000002f NotFoundHandl W org.directwebremoting.util.CommonsLoggingOutput warn In debug/test mode try viewing /[WEB-APP]/dwr/

 

And this is what I get in the browser:

 

Error 404: SRVE0295E: Error reported: 404

 

When I try https://myworkstation/servlet/MyServlet/dwr/, I get nothing logged, and this in the browser:

 

Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /MyServlet/dwr/

 

All the normal production aspects of DWR work fine.  Any ideas?

 

Thanks,

John


Reply | Threaded
Open this post in threaded view
|

Re: Can't get debug to work

Mike Wilson
Administrator
In reply to this post by John H
To add to David's answer, you have a somewhat unusual setup. First, you let the web container instantiate MyServlet that you can access on url /MyServlet.
 
Then you also expose the MyServlet class through DWR with the "new" creator. On every call to the MyServlet proxy generated in /dwr/interface/MyServlet.js you will instantiate a new MyServlet on the server-side. Maybe this is what you want, but I thought I'd point it out to you.
 
Also, as a servlet normally communicates with the outside world with data formated as markup, and an Ajax/DWR service in contrast may transfer the actual data beans, you have a possibility to design these at different layers. Then you can put the code for presentation data (used by DWR) and presentation formating to markup (used by servlet) in different classes.
 
Finally about the urls; DWR manages its own url scheme below /dwr. Specifically, DWR uses an internal url pattern for calling the different proxied classes so there is no /dwr/MyServlet url and normally you never hack urls yourself to do calls to DWR proxied classes.
 
Best regards
Mike Wilson
 
John Hester wrote:

Hi all.  I’m running DWR 2.0.10 with WebSphere 7 and debug isn’t working for me.  It worked previously, but that was when I first set up DWR several years and was likely version 2.0.6.  I haven’t touched the configuration much since.  Hopefully I’m just missing something simple.  This is in web.xml:

 

               <servlet>

                              <servlet-name>dwr-invoker</servlet-name>

                              <display-name>DWR Servlet</display-name>

                              <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>

                              <init-param>

                                             <param-name>debug</param-name>

                                             <param-value>true</param-value>

                              </init-param>

                              <init-param>

                                             <param-name>crossDomainSessionSecurity</param-name>

                                             <param-value>false</param-value>

                              </init-param>

               </servlet>

 

               <servlet-mapping>

                              <servlet-name>MyServlet</servlet-name>

                              <url-pattern>/MyServlet</url-pattern>

               </servlet-mapping>

               <servlet-mapping>

                              <servlet-name>dwr-invoker</servlet-name>

                              <url-pattern>/dwr/*</url-pattern>

               </servlet-mapping>

 

And this is in dwr.xml:

 

    <create creator="new" javascript="MyServlet">

      <param name="class" value="MyServlet"/>

    </create>

 

 

I tried adding <param name=”debug” value=”true”> to the servlet descriptor in dwr.xml, but that didn’t help.  I don’t think the crossDomainSessionSecurity setting has any bearing, but I tried flipping it to true also just in case. 

 

This is what I’m getting in the log when I try https://myworkstation/servlet/dwr/MyServlet/

 

[2/26/14 18:06:30:662 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info DWR Version 2.0.10 starting.

[2/26/14 18:06:30:663 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info - Servlet Engine: IBM WebSphere Application Server/7.0

[2/26/14 18:06:30:665 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info - Java Version:   1.6.0

[2/26/14 18:06:30:666 PST] 0000002f StartupUtil   I org.directwebremoting.util.CommonsLoggingOutput info - Java Vendor:    IBM Corporation

[2/26/14 18:06:30:865 PST] 0000002f servlet       I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [MomGroupEAR] [/servlet] [dwr-invoker]: Initialization successful.

[2/26/14 18:06:30:868 PST] 0000002f NotFoundHandl W org.directwebremoting.util.CommonsLoggingOutput warn Page not found. pathInfo='/MyServlet/' requestUrl='/servlet/dwr/QuickSearch/'

[2/26/14 18:06:30:869 PST] 0000002f NotFoundHandl W org.directwebremoting.util.CommonsLoggingOutput warn In debug/test mode try viewing /[WEB-APP]/dwr/

 

And this is what I get in the browser:

 

Error 404: SRVE0295E: Error reported: 404

 

When I try https://myworkstation/servlet/MyServlet/dwr/, I get nothing logged, and this in the browser:

 

Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /MyServlet/dwr/

 

All the normal production aspects of DWR work fine.  Any ideas?

 

Thanks,

John

Reply | Threaded
Open this post in threaded view
|

Can't get debug to work

John H
In reply to this post by John H

Thanks for the responses, Mike and David.  Nabble won’t let me reply to the thread directly even though I’m logged in, so hopefully this emailed response makes it into the same thread.

 

The problem is solved.  As you pointed out David, I was trying the wrong URL for one thing.  I had simply myworkstation/servlet/dwr at some point, but the other issue was preventing that from working either.  The other issue was that I was missing the commons-logging.jar file in WEB-INF/lib.  Once I corrected those issues, I was able to get it working.  Mike, I’ll have to look into the other issues you pointed out.  It’s been a long time since I did the initial development, so I don’t remember if I had a specific reason for using the new creator at the time.

 

Thanks,

John