This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Servlet error with the latest code
- From: S D <s dot mailinglists at gmail dot com>
- To: kawa at sources dot redhat dot com
- Date: Wed, 20 Apr 2005 08:54:35 -0700
- Subject: Re: Servlet error with the latest code
- References: <301e20f60504192340132174fb@mail.gmail.com>
- Reply-to: S D <s dot mailinglists at gmail dot com>
Did a bit more research and I think I have isolated the problem.
In the following test case,
import gnu.mapping.*;
import gnu.expr.Language;
public class Test {
public static void main(String args[]) throws Exception {
/*
Language lang = Language.getInstance("krl");
Language.setDefaults(lang);
*/
InPort ip = new InPort(System.in,"test");
}
}
if the Language.setDefaults is not called, then the next line gives
the same error.
Exception in thread "main" java.lang.ExceptionInInitializerError
at Test.main(Test.java:12)
Caused by: java.lang.NullPointerException
at gnu.mapping.InheritingEnvironment.<init>(InheritingEnvironment.java:18)
at gnu.mapping.Environment.make(Environment.java:345)
at gnu.mapping.CallContext.getEnvironment(CallContext.java:28)
at gnu.mapping.Environment.getCurrent(Environment.java:311)
at gnu.mapping.ThreadLocation.getLocation(ThreadLocation.java:78)
at gnu.mapping.ThreadLocation.get(ThreadLocation.java:112)
at gnu.mapping.Location.get(Location.java:65)
at gnu.mapping.OutPort.outDefault(OutPort.java:85)
at gnu.mapping.InPort.<clinit>(InPort.java:63)
... 1 more
But in KawaPageServlet.java the offending code is
InPort port = new InPort(resourceStream,
path.substring(path.lastIndexOf('/')+1));
Language language
= Language.getInstanceFromFilenameExtension(path);
Language.setDefaultLanguage(language);
Environment.setCurrent(language.getEnvironment());
So, the Language settings are done after the InPort creation and the
creation of InPort itself is expecting the Global Environment to be
present.
On 4/19/05, S D <s.mailinglists@gmail.com> wrote:
> I am getting the following error with the latest code. The stable 1.7
> version works fine, so it's likely not a problem with my tomcat setup.
> When I replace the 1.7 library with the 1.7.9 code, I am getting the
> below error.
>
> "description The server encountered an internal error () that
> prevented it from fulfilling this request.
>
> exception
>
> javax.servlet.ServletException
> gnu.kawa.servlet.KawaServlet.doGet(KawaServlet.java:78)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
> root cause
>
> java.lang.ExceptionInInitializerError
> gnu.kawa.servlet.KawaPageServlet.getModule(KawaPageServlet.java:74)
> gnu.kawa.servlet.KawaPageServlet.run(KawaPageServlet.java:48)
> gnu.kawa.servlet.KawaServlet.doGet(KawaServlet.java:66)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)"
>