• 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
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

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

 
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|
 
author
Posts: 23840
141
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux 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
 
Marshal
Posts: 65457
248
  • 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.
 
lowercase baba
Posts: 12760
51
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?
 
Hey cool! They got a blimp! But I have a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!