Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP 500: error..helpl Please!!!!  RSS feed

 
Jyoti Pathak
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new member to this community,so i may not be in tune with the jargon used here.i apologize for that..!!
Now,I am trying to make a JSP which few checkboxes and the user needs to "check" in order to show his selection.It is like you opt for some stuff while shopping and leave the rest.Then the java bean related to this page will insert the user selection of checkbox(s) into a table (which has been already created beforehand).for this data-access i am using SQLJ instead of the orthodox JDBC.
I am using oracle 9i and tomcat 4.1.2. and jdk1.4 in a Windows XP(home)OS.Also i am using the "thin" driver.
so when i complie my SQLJ file(which is also the bean in this case),shows no error.But when i try to view my JSP,then it shows the following error:
Description :Server encountered an internal error that prevented it from fullfilling its request.
Exception:
org.apache.jasper.JasperException : sqlj/runtime/ref/ConnectionContextImpl
and so on....
Now i have put all the SQLJ jar files (viz classes12.jar,translator.jar etc)into the TOMCAT_HOME/bin/ folder.But still its not working.
I will be glad if someone can suggest me in this regard as i am in the midst of this ordeal.
thanx in advance..!!!
Jyoti.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You stopped quoting the exception right at the interesting point! Was the problem that Jasper (the JSP translator) could not find that class?? or what?? Have you put the SQLJ library where the servlet container expects to find it?
Bill
 
Jyoti Pathak
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi william,
thanx a lot for ur reply.
i guess i figured that problem.i shud put the SQLJ library in the ~tomcat_home/common/lib folder.i was doing some thing wrong.
but now i am getting another exception.can u help me with this??i guess it says something with the null pointer exception with the java bean.
here are the files:
BEAN FILE :
/*@lineinfo:filename=ontologyBean*//*@lineinfo:user-code*//*@lineinfo:1^1*/package indusBeans;
import java.io.*;
import java.lang.*;
import java.util.*;
import java.sql.*;
import oracle.sqlj.runtime.Oracle;
import sqlj.runtime.ref.DefaultContext;
public class ontologyBean
{
//submit button pressed will result in "yes"
private String submit = null;
//name of the ontology
private String [] name = null;
//id of the ontology
private String [] id = null;
//database connection context
private DefaultContext dctx = null;


//contents of the ontology name
private ArrayList nameList = new ArrayList();
//contents of the ontology id
private ArrayList idList = new ArrayList();


//constructor
public ontologyBean()
{ }


//method to set the submit variable

public synchronized void setSubmit(String mySubmit)
{
submit = mySubmit;

}


//method to enter ontology names in an array list

public synchronized void setName(String[] myName)
{
if (myName != null)
{
for(int i=0;i<myName.length;i++)
{
if((submit.startsWith("Submit")))
{
nameList.add(myName[i]);
}
}

}//end of if

}//end of setName

//method to enter ontoloy id in an array list

public synchronized void setId(String[] myId)
{
if(myId!=null)
{
for(int i=0;i<myId.length;i++)
{
if((submit.startsWith("Submit")))
{
idList.add(myId[i]);
}
}

}
}//end of setId


//method for invoking other methods to perform database inserts

public synchronized void insertData()
{
Insert(nameList,idList);
}//end


//mehtod to initialize database inserts

public synchronized void Insert(ArrayList nameList,ArrayList idList)
{
if((nameList == null) || (idList == null))
{
try
{
//connect to the database
String dbName = "jdbc racle:thin:@localhost:1521 rcl";
String user = "indus";
String password = "indus";

dctx = Oracle.getConnection(dbName,user,password);

DBInsert(nameList,idList);//call method for insert into database


}//end of try
catch (Exception e)
{
System.out.println("some error..!!!");
}

finally
{
try
{
dctx.close();//close the database connection
}
catch (Exception e) {}
}//end of finally

}//end of if

}//end of Insert



//method performing the actual database insert

private void DBInsert(ArrayList nameList,ArrayList idList) throws SQLException
{

//insert each record into the table "ontologies"

for(int i=0;i<nameList.size();i++)
{
/*@lineinfo:generated-code*//*@lineinfo:135^4*/
// ************************************************************
// #sql [dctx] { INSERT INTO
// ONTOLOGIES(id,name)
// VALUES(:idList.get(i),:nameList.get(i))
//
// };
// ************************************************************
{
// declare temps
oracle.jdbc.OraclePreparedStatement __sJT_st = null;
sqlj.runtime.ref.DefaultContext __sJT_cc = dctx; if (__sJT_cc==null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_CONN_CTX();
sqlj.runtime.ExecutionContext.OracleContext __sJT_ec = ((__sJT_cc.getExecutionContext()==null) ? sqlj.runtime.ExecutionContext.raiseNullExecCtx() : __sJT_cc.getExecutionContext().getOracleContext());
Object __sJT_0 = idList.get(i);
Object __sJT_1 = nameList.get(i);
__sJT_st = __sJT_ec.prepareOracleBatchableStatement(__sJT_cc,"0indusBeans.ontologyBean","INSERT INTO\n\t\t\t\t\tONTOLOGIES(id,name)\n\t\t\t\tVALUES( :1 , :2 )");
// set IN parameters
__sJT_st.setObject(1,__sJT_0);
__sJT_st.setObject(2,__sJT_1);
// execute statement
__sJT_ec.oracleExecuteBatchableUpdate();
}

// ************************************************************
/*@lineinfo:user-code*//*@lineinfo:141^4*/ //end of #sql


//commit the insertion
/*@lineinfo:generated-code*//*@lineinfo:145^4*/
// ************************************************************
// #sql [dctx] { COMMIT
// };
// ************************************************************
((dctx.getExecutionContext()==null) ? sqlj.runtime.ExecutionContext.raiseNullExecCtx() : dctx.getExecutionContext().getOracleContext()).oracleCommit(dctx);

// ************************************************************
/*@lineinfo:user-code*//*@lineinfo:148^4*/


}//end of for loop

}//end of DBInsert



}/*@lineinfo:generated-code*/

ERROR OUTPUT:

Apache Tomcat/4.1.12 - Error reportHTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from
fulfilling this request.
exception
org.apache.jasper.JasperException
at org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:274)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:220)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspect(JspRuntimeLibrary.java:198)
at org.apache.jsp.ontology_jsp._jspService(ontology_jsp.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)
root cause
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:260)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:220)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspect(JspRuntimeLibrary.java:198)
at org.apache.jsp.ontology_jsp._jspService(ontology_jsp.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.NullPointerException
at indusBeans.ontologyBean.setName(ontologyBean.java:50)
... 43 more
Apache Tomcat/4.1.12

Please help me out..i am in total fix.
thanx in advance..
jyoti.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!