This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes Null pointer Exception thrown in JadeGatewayServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Null pointer Exception thrown in JadeGatewayServlet" Watch "Null pointer Exception thrown in JadeGatewayServlet" New topic
Author

Null pointer Exception thrown in JadeGatewayServlet

firoza limbada
Greenhorn

Joined: Feb 19, 2010
Posts: 11
When accessing the application via the /Base url the servlet throws the following exception


The servlet is defined on the web.xml file with url /SBFCBase. We are using ead4j, and as far as I can debug it is using the JADE_DEFAULT_ACTION_HANDLER_KEY and gets to the DefaultActionHandler.

Can you assist with what the default state/View Bean would be or where this needs to be set?

If I access the same application through the welcome page /jsp/index.jsp then there are no erros as the correct states/View Beans are accessed
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Hi,

Have you checked, if the objects have been initialized properly before accessing them.

at com.ibm.ead4j.jade.servlet.JadeGatewayServlet.processWithSession(JadeGatewayServlet.java:471)

What is happening at line 471 of JadeGatewayServlet.java


Regards
KumarRaja

Jayr Motta
Ranch Hand

Joined: Jul 30, 2010
Posts: 110

Hi firoza,

If i undestood by your explanation / stack, you're using this JADE framework and when accessing through an resource your code works well while accessing by other resource this doesn't.

Given your explanation i can't really know what's wrong but i can try, if i would look for something in there i'll look for a resource that would not been properly initialized as the Kumar said in the last reply or if this resource that you're calling doesn't pass through an filter that the other pass ..

Maybe some initialization code occurs at runtime using a url-pattern and this new url-pattern of this resource doesn't match with the filter pattern, or maybe you're not extending a class that extract data to create and execute this resouces .. the biggest problems of work with frameworks is this .. if you don't understand how it works you've to guess .. anyway .. try something in this line and check what the /jsp/index.jsp and your servlet have in uncommon (like jsp have session initialized by default, while servlet has to call getSession() or getSession(true), if it call getSession(false).get....(foobar) .. it will throw an NPE)

Feel free to keep asking until you solve this problem!


Feel free to ask me anything!
www.BlackBeltFactory.com/ui#!/ref=jmotta, SCJP 6, OCWCD JEE5, OCE EJB JEE6
firoza limbada
Greenhorn

Joined: Feb 19, 2010
Posts: 11
line 471 of JadeGatewayServlet is


the state is null thus resulting in the nullpointerexception.

I am trying to figure out how the state gets set in DefaultActionHandler - or can be reset. The state is generally set in the actionHandler class.

any ideas on how to set th state?
Jayr Motta
Ranch Hand

Joined: Jul 30, 2010
Posts: 110

As i've said before, i think you must check if they're passing into the same filter or if there is any dependency injection(annotation or whatever) into the old (that works) and not into the new, something like this.
firoza limbada
Greenhorn

Joined: Feb 19, 2010
Posts: 11
unfortunately the /jsp/index.jsp url does not go through the same code so I have nothing to compare to

Is there a way to set a user specified actionhandler for the servlet? that way I cna control the action/state
Jayr Motta
Ranch Hand

Joined: Jul 30, 2010
Posts: 110

What i'm saying is that probably could exist some filter with the url pattern set to *.jsp or /jsp/*, but if there isn't really i don't know how-to help once i don't know this framework. Sorry :/
 
 
subject: Null pointer Exception thrown in JadeGatewayServlet