jsp deploytool

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oll3i
    Contributor
    • Mar 2007
    • 679

    jsp deploytool

    i created and ejb in deploytool then added web content to it
    i added index.jsp in file refs as a welcome file
    i added ejb refs
    but when i deploy it i get 404
  • oll3i
    Contributor
    • Mar 2007
    • 679

    #2
    changed some things now after deploying i get

    type Exception report

    message

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

    exception

    org.apache.jasp er.JasperExcept ion
    org.apache.jasp er.servlet.JspS ervletWrapper.s ervice(JspServl etWrapper.java: 384)
    org.apache.jasp er.servlet.JspS ervlet.serviceJ spFile(JspServl et.java:297)
    org.apache.jasp er.servlet.JspS ervlet.service( JspServlet.java :247)
    javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:860)
    sun.reflect.Gen eratedMethodAcc essor77.invoke( Unknown Source)
    sun.reflect.Del egatingMethodAc cessorImpl.invo ke(DelegatingMe thodAccessorImp l.java:25)
    java.lang.refle ct.Method.invok e(Method.java:5 85)
    org.apache.cata lina.security.S ecurityUtil$1.r un(SecurityUtil .java:249)
    java.security.A ccessController .doPrivileged(N ative Method)
    javax.security. auth.Subject.do AsPrivileged(Su bject.java:517)
    org.apache.cata lina.security.S ecurityUtil.exe cute(SecurityUt il.java:282)
    org.apache.cata lina.security.S ecurityUtil.doA sPrivilege(Secu rityUtil.java:1 65)


    root cause

    java.lang.NullP ointerException
    org.apache.jsp. index_jsp._jspS ervice(index_js p.java:108)
    org.apache.jasp er.runtime.Http JspBase.service (HttpJspBase.ja va:105)
    javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:860)
    org.apache.jasp er.servlet.JspS ervletWrapper.s ervice(JspServl etWrapper.java: 336)
    org.apache.jasp er.servlet.JspS ervlet.serviceJ spFile(JspServl et.java:297)
    org.apache.jasp er.servlet.JspS ervlet.service( JspServlet.java :247)
    javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:860)
    sun.reflect.Gen eratedMethodAcc essor77.invoke( Unknown Source)
    sun.reflect.Del egatingMethodAc cessorImpl.invo ke(DelegatingMe thodAccessorImp l.java:25)
    java.lang.refle ct.Method.invok e(Method.java:5 85)
    org.apache.cata lina.security.S ecurityUtil$1.r un(SecurityUtil .java:249)
    java.security.A ccessController .doPrivileged(N ative Method)
    javax.security. auth.Subject.do AsPrivileged(Su bject.java:517)
    org.apache.cata lina.security.S ecurityUtil.exe cute(SecurityUt il.java:282)
    org.apache.cata lina.security.S ecurityUtil.doA sPrivilege(Secu rityUtil.java:1 65)


    note The full stack trace of the root cause is available in the Sun-Java-System/Application-Server logs.

    Comment

    • Dököll
      Recognized Expert Top Contributor
      • Nov 2006
      • 2379

      #3
      Hey there Partner!

      Can we see the code that is throwing the errors? Do stay tuned, or search a bit, perhaps something's already been added on this.

      In a bit!

      ...actually, if you needed something quick and dirty, why not have JavaScript do it for you. Google that, see what happens.

      Also, you should also look at writing a bean to check the fields, if you would rather go that way. The only thing is that you'd need figure out a way to get your error messages to load on the jsp page the occurred, otherwise you'll need to fire other jsp pages, errors.jsp, success.jsp.

      But do post your code, see what we can strip out of it.

      In a bit!
      Last edited by Dököll; Nov 11 '08, 04:08 AM. Reason: added remark

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Your index.jsp is throwing a NullPointerExce ption. Make sure every dereferenced variable in it is properly initialized.

        Comment

        • oll3i
          Contributor
          • Mar 2007
          • 679

          #5
          Code:
          <%@ page import="java.io.IOException" %>
          <%@ page import="java.io.PrintWriter" %>
          <%@ page import="java.util.Iterator" %>
          <%@ page import="javax.ejb.*, 
          javax.naming.*,
          javax.rmi.PortableRemoteObject, 
          java.rmi.RemoteException" %>
          <%! private InterfaceRemote ir  = null; 
          public void jspInit() 
          { 
          try { 
          InitialContext ic = new InitialContext(); 
          Object objRef = ic.lookup("java:ejb/ManageDBBean"); 
          InterfaceHome home = 	(InterfaceHome)PortableRemoteObject.narrow(	objRef, InterfaceHome.class); 
          ir = home.create(); 
          } catch (RemoteException ex) { 	
          ex.printStackTrace();	
          } catch (NamingException ex) {
          ex.printStackTrace();	
          } catch (CreateException ex) {
          ex.printStackTrace();
          }
          }%>
          
          <%@ page language="java" contentType="text/html; charset=windows-1250"
              pageEncoding="windows-1250"%>
          <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
          <title>Zadanie3:Wyniki z bazy danych</title>
          <style type="text/css">
          body {background-color:#ccc;FONT-FAMILY:ARIAL,VERDANA;FONT-SIZE:12PX;}
          #box {MARGIN-TOP:50PX;border:1px solid #000; background-color:#CFE;width:200px;HEIGHT:55PX;PADDING:5PX;TEXT-ALIGN:CENTER;FONT-WEIGHT:BOLD;}
          INPUT{BORDER:1PX SOLID #000;MARGIN:1PX;}
          H1{FONT-SIZE:20PX;}
          HR{COLOR:SIENNA;}
          </style>
          </head>
          <body>
          <CENTER>
          <H1>ZADANIE3</H1>
          <HR>
          
          
          	
           
          <% 
             int numberOfColumns = 0;
             numberOfColumns = ir.getNumberOfColumns("contacts");
             Map<String,String>[] rowsMap = new HashMap[numberOfColumns];
          
             for(int i=0; i<rowsMap.length; i++)
           	  rowsMap[i]= new HashMap<String, String>(); 
             
             
             rowsMap=ir.returnTable("contacts");
             
             out.println("<TABLE COLS=\"+numberOfColumns+\">"); 
             out.println("<TR>");
             
             for(Map.Entry<String,String> entry : rowsMap[0].entrySet()){
           	out.println("<TD><solid>+entry.getKey()+</solid></TD>");
             }
             out.println("</TR>");
              
              
           	for(int i=0; i<rowsMap.length; i++){
           		out.println("<TR>");
           		 for(Map.Entry<String,String> entry : rowsMap[i].entrySet()){	
           	         out.println("<TD>"+entry.getValue()+"</TD>"); 	
                       }
              out.println("</TR>");	
               } 	
          
           	out.println("</TABLE>");
          %>
          <br><br>
          
          
          
          
          
          </CENTER>
          </body>
          </html>

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Put some out.println statements to determine where the exception is being thrown at.
            P.S Why do you initialize evey element of rowsMap then soon after that you overwrite all those initialized objects with whatever is being returned by the returnTable method?

            Comment

            • oll3i
              Contributor
              • Mar 2007
              • 679

              #7
              i added some out.printlns but it doesnt display nothing

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #8
                Did you check the logs produced by stdout and stderr? If something threw an
                exception in your jspInit() method there must be something in there.

                kind regards,

                Jos

                Comment

                • oll3i
                  Contributor
                  • Mar 2007
                  • 679

                  #9
                  my server.log


                  [#|2008-11-11T12:35:52.468 +0100|SEVERE|su n-appserver-pe8.2|javax.ent erprise.system. container.web|_ ThreadID=16;|St andardWrapperVa lve[jsp]: Servlet.service () for servlet jsp threw exception
                  java.lang.NullP ointerException
                  at org.apache.jsp. index_jsp._jspS ervice(index_js p.java:112)
                  at org.apache.jasp er.runtime.Http JspBase.service (HttpJspBase.ja va:105)
                  at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:860)
                  at org.apache.jasp er.servlet.JspS ervletWrapper.s ervice(JspServl etWrapper.java: 336)
                  at org.apache.jasp er.servlet.JspS ervlet.serviceJ spFile(JspServl et.java:297)
                  at org.apache.jasp er.servlet.JspS ervlet.service( JspServlet.java :247)
                  at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:860)
                  at sun.reflect.Nat iveMethodAccess orImpl.invoke0( Native Method)
                  at sun.reflect.Nat iveMethodAccess orImpl.invoke(N ativeMethodAcce ssorImpl.java:3 9)
                  at sun.reflect.Del egatingMethodAc cessorImpl.invo ke(DelegatingMe thodAccessorImp l.java:25)
                  at java.lang.refle ct.Method.invok e(Method.java:5 85)
                  at org.apache.cata lina.security.S ecurityUtil$1.r un(SecurityUtil .java:249)
                  at java.security.A ccessController .doPrivileged(N ative Method)
                  at javax.security. auth.Subject.do AsPrivileged(Su bject.java:517)
                  at org.apache.cata lina.security.S ecurityUtil.exe cute(SecurityUt il.java:282)
                  at org.apache.cata lina.security.S ecurityUtil.doA sPrivilege(Secu rityUtil.java:1 65)
                  at org.apache.cata lina.core.Appli cationFilterCha in.internalDoFi lter(Applicatio nFilterChain.ja va:257)
                  at org.apache.cata lina.core.Appli cationFilterCha in.access$000(A pplicationFilte rChain.java:55)
                  at org.apache.cata lina.core.Appli cationFilterCha in$1.run(Applic ationFilterChai n.java:161)
                  at java.security.A ccessController .doPrivileged(N ative Method)
                  at org.apache.cata lina.core.Appli cationFilterCha in.doFilter(App licationFilterC hain.java:157)
                  at org.apache.cata lina.core.Stand ardWrapperValve .invoke(Standar dWrapperValve.j ava:263)
                  at org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:551)
                  at org.apache.cata lina.core.Stand ardContextValve .invokeInternal (StandardContex tValve.java:225 )
                  at org.apache.cata lina.core.Stand ardContextValve .invoke(Standar dContextValve.j ava:173)
                  at org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:551)
                  at org.apache.cata lina.core.Stand ardHostValve.in voke(StandardHo stValve.java:17 0)
                  at org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:551)
                  at org.apache.cata lina.core.Stand ardEngineValve. invoke(Standard EngineValve.jav a:132)
                  at org.apache.cata lina.core.Stand ardPipeline.inv oke(StandardPip eline.java:551)
                  at org.apache.cata lina.core.Conta inerBase.invoke (ContainerBase. java:933)
                  at org.apache.coyo te.tomcat5.Coyo teAdapter.servi ce(CoyoteAdapte r.java:189)
                  at com.sun.enterpr ise.web.connect or.grizzly.Proc essorTask.doPro cess(ProcessorT ask.java:604)
                  at com.sun.enterpr ise.web.connect or.grizzly.Proc essorTask.proce ss(ProcessorTas k.java:475)
                  at com.sun.enterpr ise.web.connect or.grizzly.Read Task.executePro cessorTask(Read Task.java:371)
                  at com.sun.enterpr ise.web.connect or.grizzly.Read Task.doTask(Rea dTask.java:264)
                  at com.sun.enterpr ise.web.connect or.grizzly.Task Base.run(TaskBa se.java:281)
                  at com.sun.enterpr ise.web.connect or.grizzly.Work erThread.run(Wo rkerThread.java :83)

                  Comment

                  • JosAH
                    Recognized Expert MVP
                    • Mar 2007
                    • 11453

                    #10
                    Nonono, that log file should be named stdout_20081111 or stderr_20081111

                    kind regards,

                    Jos

                    Comment

                    • oll3i
                      Contributor
                      • Mar 2007
                      • 679

                      #11
                      i dont have such logs

                      Comment

                      • JosAH
                        Recognized Expert MVP
                        • Mar 2007
                        • 11453

                        #12
                        Originally posted by oll3i
                        i dont have such logs
                        You can be pretty sure that it's not your jspInit() method that is acting up.
                        Personally I'd scrutinize that RMI stuff; do you have a SecurityManager installed?

                        kind regards,

                        Jos

                        Comment

                        • oll3i
                          Contributor
                          • Mar 2007
                          • 679

                          #13
                          nope no security manager

                          Comment

                          • oll3i
                            Contributor
                            • Mar 2007
                            • 679

                            #14
                            out of scope question i read that "IBM is releasing Cloudscape to the open source community under the name Derby " and that was in 2004 ... i was looking for cloudscape when i have derby with java sun app server

                            so cloudscape is derby?

                            Comment

                            • JosAH
                              Recognized Expert MVP
                              • Mar 2007
                              • 11453

                              #15
                              Sort of; read this.

                              kind regards,

                              Jos

                              Comment

                              Working...