X-Application Version: 3.1.3,
Tamino Version : 3.1.1
Platform : Windows2000
WebContainer : Tomcat 3.3
JDK Version : 1.3.1
Hello,
I have a problem with my application generated using Tamino X-Application. I would like to attach Java code to search.jsp file. It works when I omit
<%@ taglib uri=“404”
prefix=“xapp” %>
But then I can’t display the next page, eg. list.jsp.
Another problem is how to get the parameters from the input fields and set them in the Java code inserted within jsp file to check if they are correct.
The source code of search.jsp looks like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<%@ page language=“java” contentType=“text/html;
charset=UTF-8” errorPage=“Error.jsp”%>
<%@ page import=“java.util." %>
<%@ page import="org.w3c.dom.” %>
<%@ page import=“com.softwareag.tamino.API.dom.*” %>
<%@ taglib uri=“404”
prefix=“xapp” %>
<html xmlns=“XHTML namespace”
xmlns:xapp=“404”>
(…)
<%
String strProtocol = “http”;
String strComputer = “bla”;
String strDatabase = “bla”;
String strCollection = “pass”;
String strDoctype = “BBB”;
String strUserID = arg1;
String strPassword = arg2;
String strQuery = “[nazwa='” + strUserID + “’ and
has='” + strPassword + “']”;
String strURL = strProtocol + “://” +strComputer +
“/tamino/” + strDatabase;
String strAllQuery = strDoctype + strQuery;
String strAllURL = strURL + “/” + strCollection;
int intPageSize = 1;
try
{
TaminoClient tamino = new TaminoClient(strAllURL);
tamino.setPageSize(intPageSize);
tamino.startSession();
TaminoResult tr = tamino.query(strAllQuery);
Enumeration e = tr;
int i = 0;
while (e.hasMoreElements())
{
i = i + 1;
out.println(“Record " + Integer.toString(i) +” found.");
Element el = (Element)e.nextElement();
int ret = 1;
out.println(ret);
}
tamino.endSession();
if (i==0)
{
out.println(“No record”);
int ret = 0;
out.println(ret);}
}
catch (com.softwareag.tamino.API.dom.TaminoError myError)
{
System.err.println("Tamino Error Code: " +
myError.responseCode + “\n” +
"Tamino Error Text: " +
myError.errorText);
}
%>
(…)
Could anybody help me and give me any suggestions ?
Regards,
vs
What’s the error message if you don’t omit the import directive?
Michael
Software AG Germany, Darmstadt
Hi,
If I don’t omit the import directive, there is the following error :
Internal Servlet Error:
java.lang.NoSuchMethodError
at org.apache.crimson.tree.XmlDocumentBuilder.startDTD(XmlDocumentBuilder.java:615)
at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1131)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:122)
at org.apache.jasper.compiler.JspUtil.parseXMLDocJaxp(JspUtil.java:159)
at org.apache.jasper.compiler.JspUtil.parseXMLDoc(JspUtil.java:135)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:165)
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:728)
at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:116)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1077)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:209)
at org.apache.tomcat.facade.JasperLiaison.jsp2java(JspInterceptor.java:790)
at org.apache.tomcat.facade.JasperLiaison.processJspFile(JspInterceptor.java:731)
at org.apache.tomcat.facade.JspInterceptor.requestMap(JspInterceptor.java:506)
at org.apache.tomcat.core.ContextManager.processRequest(ContextManager.java:968)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:875)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:484)
Regards,
vs
This looks like an XML parser problem: Xerces should be used, but Crison is used.
This could be cause by various reasons:
o you’re using Tomcat 3.2. In this case, I suggest upgrading to Tomcat 3.3
o you have jaxp installed as a Java extension. In this case, you should remove jaxp. Please search the documentation for “jaxp” for more details.
You’re using jdk 1.3, don’t you?
Michael
Software AG Germany, Darmstadt
Hello,
Actually I use jdk1.3.0_02 and Tomcat3.3.
Recently I have copied Xerces instead of Crimson and removed jaxp directory.
Unfortunately I still have an error. This time it is:
Error!
An error occurred in the application program. Please report the following problem to your webmaster.
Error message: internal error
Help message:
Exception id: 999
Exception Type: ApplicationException
Stacktrace:
XException: id = 999
java.lang.NoSuchMethodError
at com.softwareag.tamino.db.API.response.dom.TDOMInputStreamInterpreter.setMessageContentItem(TDOMInputStreamInterpreter.java:131)
at com.softwareag.tamino.db.API.response.dom.TDOMInputStreamInterpreter.setResponseInfoContent(TDOMInputStreamInterpreter.java:115)
at com.softwareag.tamino.db.API.response.dom.TDOMInputStreamInterpreter.doInterpret(TDOMInputStreamInterpreter.java:87)
at com.softwareag.tamino.db.API.response.TInputStreamInterpreter.interpret(TInputStreamInterpreter.java:61)
at com.softwareag.tamino.db.API.response.TResponseBuilderImpl.doBuild(TResponseBuilderImpl.java:90)
at com.softwareag.tamino.db.API.response.TResponseBuilderImpl.buildForXML(TResponseBuilderImpl.java:69)
at com.softwareag.tamino.db.API.accessor.TGenericAccessorImpl.execute(TGenericAccessorImpl.java:56)
at com.softwareag.tamino.db.API.accessor.TSystemAccessorImpl.diagnose(TSystemAccessorImpl.java:193)
at com.softwareag.tamino.db.API.accessor.TSystemAccessorImpl.getServerVersion(TSystemAccessorImpl.java:108)
at com.softwareag.xtools.xapplication.store.TaminoStore.getVersion(TaminoStore.java:320)
at com.softwareag.xtools.xapplication.store.TaminoStore.(TaminoStore.java:246)
at com.softwareag.xtools.xapplication.jsp.ApplicationContext.newStore(ApplicationContext.java:235)
at com.softwareag.xtools.xapplication.jsp.ApplicationContext.(ApplicationContext.java:107)
at com.softwareag.xtools.xapplication.jsp.ApplicationContext.forServlet(ApplicationContext.java:162)
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findApplicationContext(ServletSessionContext.java:170)
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findSessionContext(ServletSessionContext.java:96)
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findSessionContext(ServletSessionContext.java:71)
at com.softwareag.xtools.xapplication.jsp.JspTag.checkContext(JspTag.java:252)
at com.softwareag.xtools.xapplication.jsp.JspTag.doStartTag(JspTag.java:133)
at search1_5._jspService(search1_5.java:140)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:484)
Could you tell me any more suggestions what to do to solve my problem .
Regards,
vs
Looks as if Tomcat sees multiple version of the Tamino API?! Did you copy additional jar files into one of Tomcats lib directories? This error should not happen if you run the appliation in a vanilla Tomcat 3.3.1 installtion.
Michael
Software AG Germany, Darmstadt
Hello,
In fact first I copied additional jar files into lib/container directory. It wasn’t OK. Then I downloaded Tomcat (v.3.3.1) from http://jakarta.apache.org/builds/jakarta-tomcat/release/v.3.3/bin. And now I have crimson.jar again and my application doesn’t work.
To be quite honest I have no idea what to do next.
Could you help me ?
Regards,
vs
Why did you add crimson to your Tomcat setup?
I should work if you use a fresh Tomcat 3.3.1 installation – without any additional jar files.
Michael
Software AG Germany, Darmstadt