This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Null pointer Exception thrown in JadeGatewayServlet

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 110
Google Web Toolkit Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
firoza limbada
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 110
Google Web Toolkit Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 110
Google Web Toolkit Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 :/
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic