• Post Reply Bookmark Topic Watch Topic
  • New Topic

Invalid Number Exception  RSS feed

 
kerthi Joe
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java code has a oracle database call, on which the query execution is success and getting the success message from the database.

At times am getting exception at the line,

condition.

Full Stack trace of the exception,

ORA-01722: invalid number

   ERROR stderr:71 - java.sql.SQLSyntaxErrorException: ORA-01722: invalid number
   ERROR stderr:71 -
   ERROR stderr:71 - at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
   ERROR stderr:71 - at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
   ERROR stderr:71 - at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
   ERROR stderr:71 - at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
   ERROR stderr:71 - at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
   ERROR stderr:71 - at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
   ERROR stderr:71 - at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
   ERROR stderr:71 - at oracle.jdbc.driver.T4CStatement.fetch(T4CStatement.java:1108)
   ERROR stderr:71 - at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:373)
   ERROR stderr:71 - at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:277)
   ERROR stderr:71 - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   ERROR stderr:71 - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   ERROR stderr:71 - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   ERROR stderr:71 - at java.lang.reflect.Method.invoke(Method.java:606)
   ERROR stderr:71 - at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
   ERROR stderr:71 - at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
   ERROR stderr:71 - at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
   ERROR stderr:71 - at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777)
   ERROR stderr:71 - at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706)
   ERROR stderr:71 - at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
   ERROR stderr:71 - at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
   ERROR stderr:71 - at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
   ERROR stderr:71 - at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
   ERROR stderr:71 - at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
   ERROR stderr:71 - at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
   ERROR stderr:71 - at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
   ERROR stderr:71 - at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
   ERROR stderr:71 - at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
   ERROR stderr:71 - at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
   ERROR stderr:71 - at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
   ERROR stderr:71 - at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
   ERROR stderr:71 - at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
   ERROR stderr:71 - at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
   ERROR stderr:71 - at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
   ERROR stderr:71 - at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
   ERROR stderr:71 - at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
   ERROR stderr:71 - at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
   ERROR stderr:71 - at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
   ERROR stderr:71 - at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
   ERROR stderr:71 - at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
   ERROR stderr:71 - at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
   ERROR stderr:71 - at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
   ERROR stderr:71 - at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)
   ERROR stderr:71 - at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
   ERROR stderr:71 - at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
   ERROR stderr:71 - at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
   ERROR stderr:71 - at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
   ERROR stderr:71 - at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
   ERROR stderr:71 - at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   ERROR stderr:71 - at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   ERROR stderr:71 - at java.lang.Thread.run(Thread.java:745)
 
Vibhor Rawat
Greenhorn
Posts: 9
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you share the whole code here?
 
Dave Tolls
Ranch Foreman
Posts: 3056
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ORA-01722: invalid number

Something in your SQL is attempting to convert a VARCHAR to a NUMBER and it isn't a number.   Most likely it's blank.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the query you are trying to execute. Also confirm the contents of the table in question, particularly what DT pointed out. This is almost certainly nothing to do with your Java® code.

Don't put stack traces in code tags, and don't double‑space the text. I have removed the tags and blank lines.
 
kerthi Joe
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Here, if the selectedArr has 1 value it works, But when there is a selection of 2,3 inputs -- rs.next() throws Invalid number exception . But again runs fine for 4,5 etc.

But for all these selection resultSet does not have any rows in DB.
 
Dave Tolls
Ranch Foreman
Posts: 3056
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My previous comment still applies.

Since the actual query (at a guess) is sat inside a stored procedure then that would be the place to look.
 
kerthi Joe
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please find the query that is defined in the stored proc, it is a simple select query.

 
Dave Tolls
Ranch Foreman
Posts: 3056
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And when you use the data for a query that fails in something like SQL Developer, what do you get?

And T_APP is a table and not a view of some description?
 
kerthi Joe
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application uses an oracle database as backend and T_APP is a table
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The stored procedure your Java code calls, it has a parameter or two. The SQL code you posted, it doesn't have any parameters.
 
Dave Tolls
Ranch Foreman
Posts: 3056
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kerthi Joe wrote:My application uses an oracle database as backend and T_APP is a table


That didn't answer my first (and possibly more important) question, though.

When you execute the stored procedure through something like SQL Developer using the same array of data does it fail?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!