• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.lang.String cannot be cast to java.math.BigDecimal  RSS feed

 
Ramesh kakarla
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am getting below error message. can any one please help me on this.

java.lang.ClassCastException: java.lang.String cannot be cast to java.math.BigDecimal at jsp_servlet._spd._searchresult.__spdarticlehistoryreport._jspService(__spdarticlehistoryreport.java:175)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:502)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:429)
at com.standardandpoors.framework.presentation.JspView.generateView(JspView.java:83)
at com.standardandpoors.framework.controller.PresentationControllerBean.process(PresentationControllerBean.java:206)
at com.standardandpoors.framework.controller.PresentationControllerBean_6v6tqk_EOImpl.process(PresentationControllerBean_6v6tqk_EOImpl.java:61)
at com.standardandpoors.framework.controller.SpControllerServlet.doPost(SpControllerServlet.java:603)
at com.standardandpoors.apps.hp.controller.HPControllerServlet.doPost(HPControllerServlet.java:64)
at com.standardandpoors.framework.controller.SpControllerServlet.service(SpControllerServlet.java:431)
at com.standardandpoors.apps.hp.controller.HPControllerServlet.service(HPControllerServlet.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3594)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
tryyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
java.rmi.RemoteException: EJB Exception: ; nested exception is:
com.standardandpoors.SpException
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:103)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:857)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:809)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:514)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:60)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvokeTxRetry(BaseRemoteObject.java:441)
at com.standardandpoors.framework.controller.PresentationControllerBean_6v6tqk_EOImpl.process(PresentationControllerBean_6v6tqk_EOImpl.java:75)
at com.standardandpoors.framework.controller.SpControllerServlet.doPost(SpControllerServlet.java:603)
at com.standardandpoors.apps.hp.controller.HPControllerServlet.doPost(HPControllerServlet.java:64)
at com.standardandpoors.framework.controller.SpControllerServlet.service(SpControllerServlet.java:431)
at com.standardandpoors.apps.hp.controller.HPControllerServlet.service(HPControllerServlet.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
[24/Mar/2015 11:29:21:824] debug: |SpResultSet|SpResultSet Constructor|[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'|4|
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message is pretty self explanatory. You have a String object, and you are trying to use it (or cast it to) where a BigDecimal object is expected.

Henry
 
Campbell Ritchie
Marshal
Posts: 56533
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...And welcome to the Ranch

You cannot cast a String to any other class except Object. You can however pass a String to a BigDecimal constructor.
 
Ramesh kakarla
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on log stack trace in which class(JspView.java or PresentationControllerBean.java) I need to convert the string object. Please do the needful.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the String contain? If it contains something like "Fred is a novice programmer", how should that be converted to a number?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!