Topic
  • 3 replies
  • Latest Post - ‏2013-07-17T02:36:36Z by kevintap
aquDan
aquDan
53 Posts

Pinned topic Servlet not getting executed

‏2013-07-15T14:43:17Z |

Hi.  I am using Servlet in my project for creating elements.   I have defined servlet and its mapping in web.xml, but when i publish, it got overridden.  So to resolve this, i have written a separate .xml file which has serlvet and servlet mapping.  Then after publishing i can see my entry in web.xml and servlet is getting executed fine.  But the same, when i export as Websphere Portlet Factory war and install, then my servlet is not getting executed.  It is showing me the error "/ProjectName/YourServletName has not been defined".  Can anyone please help on this ?

  • kevintap
    kevintap
    748 Posts

    Re: Servlet not getting executed

    ‏2013-07-15T21:17:40Z  

    When you say that you have written a separate .xml file which has the servlet and servlet mapping, I assume that you're referring to placing an .xml file under WEB-INF/bin/deployment/extensions/standalone.web in your project?  If so, then you will also need to place this same file under WEB-INF/bin/deployment/extensions/portlet.web in your project.  The standalone.web folder is for extension fragments used to build standalone war files (which are used for publishing from the Designer).  The portlet.web folder is for extension fragments used to build portlet war files (when you export a Portlet WAR file from the Designer).

  • aquDan
    aquDan
    53 Posts

    Re: Servlet not getting executed

    ‏2013-07-16T07:09:45Z  
    • kevintap
    • ‏2013-07-15T21:17:40Z

    When you say that you have written a separate .xml file which has the servlet and servlet mapping, I assume that you're referring to placing an .xml file under WEB-INF/bin/deployment/extensions/standalone.web in your project?  If so, then you will also need to place this same file under WEB-INF/bin/deployment/extensions/portlet.web in your project.  The standalone.web folder is for extension fragments used to build standalone war files (which are used for publishing from the Designer).  The portlet.web folder is for extension fragments used to build portlet war files (when you export a Portlet WAR file from the Designer).

    Thanks kevin.  Now i can see the entry in the war file if i export as a portlet war.  But still, i am getting the error "/ProjectName/YourServletName has not been defined".  Can you please help ?

  • kevintap
    kevintap
    748 Posts

    Re: Servlet not getting executed

    ‏2013-07-17T02:36:36Z  
    • aquDan
    • ‏2013-07-16T07:09:45Z

    Thanks kevin.  Now i can see the entry in the war file if i export as a portlet war.  But still, i am getting the error "/ProjectName/YourServletName has not been defined".  Can you please help ?

    I'm not sure what else to suggest here; I can only think of a few things that might be wrong.  If your web.xml looks correct inside the portlet WAR, then the servlet should be accessible.  First, I might suggest comparing your servlet configuration in web.xml against the configuration for the AjaxServlet that WEF provides.  Next, I assume that you have properly re-deployed your newly generated WAR file to the portal server (and not just copied the changed web.xml into an existing deployment).  And finally, if you are connecting to your portal server through a front end web server (Apache, IHS), did you remember to regenerate your plugin-cfg.xml file?