5 Replies Latest reply on Apr 18, 2005 8:30 AM by sovattha

    javax.servlet.ServletException: no main

    sdash324

      I am trying to deploy the HelloWorldPortlet into JBoss Portal 2.0 and JBoss Server 4.0.1 RC1 and i am getting this exception when i try to accesss the page via http://localhost:8080/portal/index.html?page=hello

      message

      description The server encountered an internal error () that prevented it from fulfilling this request.

      exception

      javax.servlet.ServletException: javax.servlet.ServletException: no main
      org.jboss.portal.core.servlet.TransactionFilter.doFilter(TransactionFilter.java:85)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)


      root cause

      org.jboss.portal.common.transaction.BusinessException: javax.servlet.ServletException: no main
      org.jboss.portal.common.transaction.Demarcator.requiresNew(Demarcator.java:58)
      org.jboss.portal.core.servlet.TransactionFilter.doFilter(TransactionFilter.java:74)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)


      note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.


      --------------------------------------------------------------------------------


      I will appreciate any pointers to solve this.

      Satya

        • 1. Re: javax.servlet.ServletException: no main
          theute

          Check your xml descritor files

          • 2. Re: javax.servlet.ServletException: no main
            theute

            Ohhh now i understand why everybody is talking about the helloworldportlet, sorry i didn't know we had such an example in the doc.

            There is an error in the doc.
            In helloworld-pages.xml:

            replace:

            <instance-ref>/portal-hello.HelloWorldPortlet.HelloWorldPortletInstance</instance-ref>

            by
            <instance-ref>/helloworld.HelloWorldPortlet.HelloWorldPortletInstance</instance-ref>


            In fact it should be the context of your war file.

            • 3. Re: javax.servlet.ServletException: no main

              the context name doesn't seem to make the difference.
              I checked it over several times, tried to deploy as an EAR and as a WAR with no success. Looks like something's missing in the doc. Perhaps a web.xml entry (Servlet, listener)? I started to debug the issue, but haven't figured it out yet (too much new code and my head's spinning ;)

              • 4. Re: javax.servlet.ServletException: no main

                user error: my war didn't contain a portlet.xml ; my ant template didn't add it in; once the correct context name is used it works (thanks Thomas!). I run into other problems now, but I assume for the moment that those are user errors as well..... boy, do I feel stupid :(

                • 5. Re: javax.servlet.ServletException: no main
                  sovattha

                  Had the same problem with the example file downloaded on the site.
                  Added a / in the helloworld-pages.xml

                  <pages>
                   <portal-name>default</portal-name>
                   <page>
                   <page-name>helloworld</page-name>
                   <window>
                   <window-name>HelloWorldPortletWindow</window-name>
                   <instance-ref>/helloworld.HelloWorldPortlet.HelloWorldPortletInstance</instance-ref>
                   <default>true</default>
                   <region>left</region>
                   <height>0</height>
                   </window>
                   </page>
                  </pages>
                  
                  


                  And everything went well.