• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

java.lang.IllegalArgumentException  RSS feed

 
Ranch Hand
Posts: 66
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I'm trying to apply search (select statement) based  in a specific fields  in my DB and reflect the result in my JSF page but I have this exception:

javax.faces.event.AbortProcessingException: /SearchIdeas.jsp(148,24) '#{searchIdeasBean.doSearch}' java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException




the user will pass 4 values (no, title,date,status) then the result will be show in the page




methods on the DAO:



 
Bartender
Posts: 19814
93
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Wadha!

In order to tell what's going on, we'd need to see the View Template. That seems to be where the primary error is, based on your message.

However.

Since your View Template seems to be a JSP file, and JSP View Templates have been obsolete for probably 10 years now, I'm afraid you are trying to work with obsolete and unsupported technology.
 
Marshal
Posts: 60869
190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't obscure exceptions by throwing a different exception. If you are having problems, make sure to print the stack trace at least. You need to know what is going wrong.
Where are you getting the exception from? It doesn't appear to be from this code; there must be something else you are calling that is throwing that exception..
 
wadha alketbi
Ranch Hand
Posts: 66
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your replay,


This is the jsp file:





the method in bean class:




method in delegate class:
 
Tim Holloway
Bartender
Posts: 19814
93
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's JSF version 1.0. JSF 1.0 is dead. Long dead.

It's also improperly designed. CommandLinks do not take parameters. The action method must have no arguments and must return a String (or null). The data used for action methods comes from the backing bean itself.
 
wadha alketbi
Ranch Hand
Posts: 66
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:Yes, that's JSF version 1.0. JSF 1.0 is dead. Long dead.

It's also improperly designed. CommandLinks do not take parameters. The action method must have no arguments and must return a String (or null). The data used for action methods comes from the backing bean itself.




Thank you Tim Holloway

The action of the CommandLink is calling a method in the backing bean called goAttachments and goDeatils in order to go to these pages, so if the action method must return string or null, how it will be?
 
Tim Holloway
Bartender
Posts: 19814
93
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JSF version 1, the action method is invoked by the FacesServlet when the button/link submits itself. It must return the name of a navigation rule defined in the faces-config.xml file that indicates the ID of the next View to be presented. If the action method returns null, the same View is simply re-displayed.

In JSF 2, additional abilities were added so that faces-config.xml was no longer necessary to navigate, although it can still be used.
 
wadha alketbi
Ranch Hand
Posts: 66
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:In JSF version 1, the action method is invoked by the FacesServlet when the button/link submits itself. It must return the name of a navigation rule defined in the faces-config.xml file that indicates the ID of the next View to be presented. If the action method returns null, the same View is simply re-displayed.

In JSF 2, additional abilities were added so that faces-config.xml was no longer necessary to navigate, although it can still be used.





the action method is return the name of the navigation rule, for example the CommendLink of the details call this method in the bean class and it return the NR:



faces-config.xml:






 
wadha alketbi
Ranch Hand
Posts: 66
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I Think the problem is not from the Commend Link because even if i remove it from the page the exception is shown.
 
wadha alketbi
Ranch Hand
Posts: 66
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I change the query to:



I have this exception now:
java.sql.SQLException: Invalid column index

and when I did not enter values the exception is:
java.lang.NullPointerException

any help!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!