This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Servlet error with the latest code


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)"
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]