ERROR:JAVA.LANG.CLASSCASTEXCEPTION WITH JDEVELOPER 10.0.1.3

I´m trying to use JSTL functions but I have the error
"Error:java.lang.ClassCastException with JDeveloper 10.0.1.3".
When I make or rebuild the code I have the error.
The test <c:when test="${fn:length(P_LIGACOES) > 0}" > has error. I´ve been
used others functions and the error is the same.
Please, see JSP code as follows:
<%@ page import="java.text.DateFormat"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.text.NumberFormat"%>
<%@ page import="com.celesc.tf.BilheteTelefonico"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Ligações Telefônicas</title>
<style type="text/css">
Body{
background-image: url(images/fdo.jpg);
background-repeat: no-repeat;
background-color: #FFFFFF;
</style>
<link href="css/ligtel.css" rel="stylesheet" type="text/css">
</head>
<body>
<h1 align=center> </h1>
<h1 align=center> </h1>
<c:choose>
<c:when test="${!empty mensagem}">
<h1 align=center>
<img src="images/erro.jpg"><font size="5" face="Verdana, Arial, Helvetica,
sans-serif"><c:out value="${mensagem}"/></font></h1>
</c:when>
<c:otherwise>
<%
Vector ligacoes = (Vector) request.getAttribute("P_LIGACOES");
SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy
HH:mm:ss");
double totalligacoes = 0;
NumberFormat preco = NumberFormat.getCurrencyInstance();
%>
<c:choose>
<c:when test="${fn:length(P_LIGACOES) > 0}" >
<h1 align=center><font size="5" face="Verdana, Arial, Helvetica,
sans-serif">Nenhuma ligação Realizada</font></h1>
</c:when>
<c:otherwise>
<h1 align=center><font size="5" face="Verdana, Arial, Helvetica,
sans-serif">Relação das Ligações</font></h1>
<table class="table-normal" width="70%" align="center">
<tr class="table-result">
<td colspan="5"><b><%= ligacoes.size()%> </b> Ligações Realizadas</td>
</tr>
<tr class="table-title">
<td>Fone Chamado</td>
<td>Ramal</td>
<td>Data</td>
<td>Duração</td>
<td>Custo(R$)</td>
</tr>
<c:forEach items="${P_LIGACOES}" var="bilhete">
<tr class="table-content">
<td><c:out value="${bilhete.numeroChamado}"/></td>
<td><c:out value="${bilhete.ramalOrigem}"/></td>
<td><c:out value="${bilhete.dataLigacao}"/></td>
<td><c:out value="${bilhete.duracao}"/></td>
<!--<td><c:out value="${bilhete.custo}"/></td>-->
<td><c:out value="${bilhete.custo}"/></td>
<c:set var="totalligacoes" value="${totalligacoes +
bilhete.custo}"/>
</tr>
</c:forEach>
<tr class="table-result">
<td colspan="4" align="right"><B>Total</B></td>
<!-- <td ><B><%= preco.format(totalligacoes)%></B></td> -->
<td><B><c:out value="${totalligacoes}" /></B></td>
</tr>
</table>
</c:otherwise>
</c:choose>
</c:otherwise>
</c:choose>
</body>
</html>

Hi,
Please make sure that there is no other version of *"net.nrj.alf.DimensionLabel"* class present in any other Class Loader
There are various kind of Class Loaders : PreMordial Class Loader, BootStrap ClassLoader, System Class Loader (WebLogic ClassLoader), Application ClassLoader, Module Class Loader....
net.nrj.service.SearchServiceProcessor java.lang.ClassCastException: net.nrj.alf.DimensionLabel java.lang.ClassCastException: net.nrj.alf.DimensionLabel If your code is working fine in WLS9.2 it means in WLS10.3.3 the same class is getting loaded from different Class Loaders...In order to find out which classLoader is being used to load that class please do the following:
<b><font color=maroon>
Class dimentionLevel=Class.forName("net.nrj.alf.DimensionLabel")
ClassLoader cl=dimentionLevel.getClassLoader();
System.out.println("\n\n\t DimentionLevel is loaded from ClassLoader: "+cl);
</font></b>
Above 3 Lines of code you need to write for "net.nrj.service.SearchServiceProcessor" class as well...Because i suspect that these two classes are getting loaded from two different class Loaders.
If the Application Code is 100% correct The Main reason of ClassCastException is Classes are getting Loaded from two Different Class Loaders. You can also look at the Filtering ClassLoader Feature of WebLogic to Tell WebLogic to Load some Classes from a Specific ClassLoaders...As described Here .*http://middlewaremagic.com/weblogic/?page_id=192*
Thanks
Jay SenSharma
http://middlewaremagic.com/weblogic/?page_id=2261  (Middleware magic Is Here)

Similar Messages

  • B2B-50014:  General Error: java.lang.ClassCastException: oracle.xml.parser.

    Hi Gurus,
    Trying to pass an OAG XML 9.0 payload to a remote trading Partner, over an AS2 channel -- message is both Signed and Encrypted, Cert has been imported.
    I get the B2B-50014: General Error.
    B2B is able to identify the Agreement correctly.
    LOGS:
    [2011-05-12T12:27:03.292+00:00] [soa_ms_1] [ERROR] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@243d15ed] [userId: <anonymous>] [ecid: bb3e7e8ee8316823:74cad781:12fc9c42815:-7ff5-0000000000172f4e,0] [APP: soa-infra] Error -: B2B-50014: General Error: java.lang.ClassCastException: oracle.xml.parser.v2.XMLParseException cannot be cast to oracle.tip.b2b.system.B2BDomainException[[
         at oracle.tip.b2b.engine.Engine.processOutgoingMessageImpl(Engine.java:1571)
         at oracle.tip.b2b.engine.Engine.processOutgoingMessage(Engine.java:800)
         at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3785)
         at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3127)
         at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:619)
         at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:220)
         at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
         at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
         at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Caused by: java.lang.ClassCastException: oracle.xml.parser.v2.XMLParseException cannot be cast to oracle.tip.b2b.system.B2BDomainException
         at oracle.tip.b2b.document.oag.OagDocumentPlugin.validateXMLDocument(OagDocumentPlugin.java:1237)
         at oracle.tip.b2b.document.oag.OagDocumentPlugin.processOutgoingDocument(OagDocumentPlugin.java:819)
         at oracle.tip.b2b.msgproc.Request.outgoingRequestPostColab(Request.java:1483)
         at oracle.tip.b2b.msgproc.Request.outgoingRequest(Request.java:990)
         at oracle.tip.b2b.engine.Engine.processOutgoingMessageImpl(Engine.java:1511)
         ... 8 more
    java.lang.ClassCastException: oracle.xml.parser.v2.XMLParseException cannot be cast to oracle.tip.b2b.system.B2BDomainException
         at oracle.tip.b2b.document.oag.OagDocumentPlugin.validateXMLDocument(OagDocumentPlugin.java:1237)
         at oracle.tip.b2b.document.oag.OagDocumentPlugin.processOutgoingDocument(OagDocumentPlugin.java:819)
         at oracle.tip.b2b.msgproc.Request.outgoingRequestPostColab(Request.java:1483)
         at oracle.tip.b2b.msgproc.Request.outgoingRequest(Request.java:990)
         at oracle.tip.b2b.engine.Engine.processOutgoingMessageImpl(Engine.java:1511)
         at oracle.tip.b2b.engine.Engine.processOutgoingMessage(Engine.java:800)
         at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3785)
         at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3127)
         at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:619)
         at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:220)
         at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
         at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
         at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Error -: B2B-50014: General Error: java.lang.ClassCastException: oracle.xml.parser.v2.XMLParseException cannot be cast to oracle.tip.b2b.system.B2BDomainException
         at oracle.tip.b2b.engine.Engine.processOutgoingMessageImpl(Engine.java:1571)
         at oracle.tip.b2b.engine.Engine.processOutgoingMessage(Engine.java:800)
         at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3785)
         at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3127)
         at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:619)
         at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:220)
         at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
         at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
         at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Caused by: java.lang.ClassCastException: oracle.xml.parser.v2.XMLParseException cannot be cast to oracle.tip.b2b.system.B2BDomainException
         at oracle.tip.b2b.document.oag.OagDocumentPlugin.validateXMLDocument(OagDocumentPlugin.java:1237)
         at oracle.tip.b2b.document.oag.OagDocumentPlugin.processOutgoingDocument(OagDocumentPlugin.java:819)
         at oracle.tip.b2b.msgproc.Request.outgoingRequestPostColab(Request.java:1483)
         at oracle.tip.b2b.msgproc.Request.outgoingRequest(Request.java:990)
         at oracle.tip.b2b.engine.Engine.processOutgoingMessageImpl(Engine.java:1511)
         ... 8 more
    Kindly advise.
    Regards,
    Sambhav.

    Hi Anuj,
    Thanks, i disabled the agreement validation, ran the file through. It worked.
    Also, tried to validate the XML instance with the XSD, and it threw no errors, so the payload conforms to the XSD, but will validate.
    Other thing being, this is an OAG-XML PO, so had the XSD, not the Guideline file.
    Regards,
    Sambhav.

  • Crystal Reports 2013 java-error "java.lang.ClassCastException: class com.crystaldecisions..." when promoting

    Hi,
    when promoting "Crystal Report 2013" report (with data connectivity BW MDX Query) from BO DEV to BO PROD with BO Promotion Mgmt (LCM), we get the following error message in LCM jobs history:
    Resolution Status=Overwritten, Dependency Status=All the required dependencies are included.,
    Commit Status=Commit attempted and failed.,
    Promotion Status=Failure : Object promoted. Update failed.
    Error: java.lang.ClassCastException: class com.crystaldecisions.sdk.occa.report.lib.ByteArray:java.net.URLClassLoader@1d634758 incompatible
    with class com.crystaldecisions.sdk.occa.report.lib.PropertyBag:java.net.URLClassLoader@1d634758
    The report itself is present on BO PROD, but the overwrite (BW DEV MDX Query-> BW PROD MDX Query) is not applied, so report connectivity still points to the BW Query on the development system :-( .
    Moreover, the overwrite itself is detected when the job is "test promoted" ("active overwrite").
    Before, we successfully were able to transport crystal reports 2013 with overwrite (the connection then pointed to BW PROD). No idea yet what suddenly changed that...
    Any ideas what causes the error and what can fix it (no posts found, no SAP note, google also no hits)?
    Best regards
    Florian Pitschi

    Update:
    After more investigation, it looks as if the BO Server "CrystalReports2013ReportApplicationServer"
    from time to time has an issue - not only when promoting, but also when viewing publications that contain Crystal Report documents or when executing them, the java class error or similar issue is thrown.
    Did sb face similar behaviour and knows what is the root cause for "CrystalReports2013ReportApplicationServer" not working probably and throwing the java-class error? - it was running fine for several months, now, the class error showed up twice in one month.
    We need to find out what is causing the issue (aleady checked tomcat and BO-logfiles...).
    Best Regards
    Florian

  • Serialization error: java.lang.ClassCastException: [Ljava.lang.Object;

    hi
    i am accessing dot net web service from java using jax rpc dii. Input to web service is simple string and output is also string.
    i am getting following error
    serialization error: java.lang.ClassCastException: [Ljava.lang.Object;
    the above exception is coming from following code
    call.setProperty(ENCODING_STYLE_PROPERTY ,"");
    QName qts = new QName("http://www.w3.org/2001/XMLSchema", "string");
    call.addParameter("String_1", qts, ParameterMode.IN);
    call.setReturnType( qts);
    call.setOperationName( new QName(URI , "hello")); //hello mthd name
    TypeMappingRegistry dt=
    (TypeMappingRegistry)svc.getTypeMappingRegistry();
    Object[] inParams = new Object [] {"win"} ;
    String res = (String)call.invoke(inParams) ;
    i am not able to find out what the error is ??
    pls help.............

    I tried using
    String [] lparams = new String {"win"};
    but no success same eror
    serialization error: java.lang.ClassCastException
    do we have to register any serializer for the parameters we pass ??
    any solution will be of great help ...
    my code is as follows
    String URI ="http://tempuri.org/";
    String SOACT="http://tempuri.org/hello";
    QName qname=new QName(URI,"AddNumbers");
    ServiceFactory serviceFactory= ServiceFactory.newInstance();
    Service svc=serviceFactory.createService( qname );
    Call call=svc.createCall();
    call.setTargetEndpointAddress("http://samrat/service/addservice.asmx" );
    call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
    call.setProperty(Call.SOAPACTION_URI_PROPERTY, SOACT);
    String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
    call.setProperty(ENCODING_STYLE_PROPERTY ,"");
    call.setOperationName( new QName(URI , "hello"));
    TypeMappingRegistry dt=(TypeMappingRegistry)svc.getTypeMappingRegistry();
    Object inParams [] = new String [] {"win"} ;
    Object res = (String)call.invoke(inParams) ; <--here i am getting error
    i am accessing simple dot net web service servicename is hello which takes a string and returns same string ..
    Any way thanxs for your suggestions .. keep on replying hope to solve this error asap ..
    thanx once again
    Samrat.A.Barve

  • Error: java.lang.NoClassDefFoundError in Jdeveloper 9.0.5.2.(Build 1618)

    Error: java.lang.NoClassDefFoundError org.apache.struts.taglib.BaseHandlerTag
    Hi,
    We are using Jdeveloper10g version 9.0.5.2(Build 1618) as our IDE. We have a struts based controller architecture in our project. So we frequently use struts tags in our jsp pages. The application is working fine but sometimes when i do some changes in one of or a number of the jsp files in Jdeveloper , after recompiling i get the above error in number of jsps though i haven't touched those jsps at all.
    I found a work around for this problem by just shutting down the Jdeveloper and again starting it.
    It gives such kind of errors for only stuts based tag containing jsps.
    Do anybody has any solution for this persistent problem.
    My whole team is facing this problem.
    With Warm Regards,
    Datta.

    No anyone knows?

  • Weblogic server node start up error: java.lang.ClassCastException

    Can anyone please help me with the below error?
    I am trying to deploy a custom authorization provider, while weblogic is already configured with other custom authorization providers. I set my provider on high precedence and tried restarting all the nodes...
    Adminserver started successfully but one of the node failed to start with the below error.. can anyone assist me here?
    ####<Aug 5, 2010 10:23:10 AM CDT> <Error> <Deployer> <cas5s033z3> <node_gfw_c_1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1281021790177> <BEA-149231> <Unable to set the activation state to true for the application 'memrApp'.
    java.lang.ClassCastException: $Proxy37
         at com.bea.p13n.entitlements.management.internal.SecurityPolicyDelegate.policyExists(SecurityPolicyDelegate.java:290)
         at com.bea.p13n.entitlements.management.internal.SecurityPolicyDelegate.policyExists(SecurityPolicyDelegate.java:273)
         at com.bea.p13n.entitlements.management.internal.RDBMSSecurityPolicyManager.getSecurityPolicy(RDBMSSecurityPolicyManager.java:204)
         at com.bea.p13n.entitlements.management.SecurityPolicyManager.getSecurityPolicy(SecurityPolicyManager.java:119)
         at com.bea.content.manager.internal.ContentUpgradeListener.hasUpgradeBeenDone(ContentUpgradeListener.java:105)
         at com.bea.content.manager.internal.ContentUpgradeListener.postStart(ContentUpgradeListener.java:58)
         at weblogic.application.internal.flow.BaseLifecycleFlow$PostStartAction.run(BaseLifecycleFlow.java:209)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.application.internal.flow.BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:95)
         at weblogic.application.internal.flow.BaseLifecycleFlow.postStart(BaseLifecycleFlow.java:62)
         at weblogic.application.internal.flow.TailLifecycleFlow.activate(TailLifecycleFlow.java:33)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:641)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:229)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
         at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:181)
         at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:352)
         at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:52)
         at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:186)
         at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
         at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
         at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
         at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
         at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
         at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
         at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    java.lang.ClassCastException: $Proxy37
         at com.bea.p13n.entitlements.management.internal.SecurityPolicyDelegate.policyExists(SecurityPolicyDelegate.java:290)
         at com.bea.p13n.entitlements.management.internal.SecurityPolicyDelegate.policyExists(SecurityPolicyDelegate.java:273)
         at com.bea.p13n.entitlements.management.internal.RDBMSSecurityPolicyManager.getSecurityPolicy(RDBMSSecurityPolicyManager.java:204)
         at com.bea.p13n.entitlements.management.SecurityPolicyManager.getSecurityPolicy(SecurityPolicyManager.java:119)
         at com.bea.content.manager.internal.ContentUpgradeListener.hasUpgradeBeenDone(ContentUpgradeListener.java:105)
         at com.bea.content.manager.internal.ContentUpgradeListener.postStart(ContentUpgradeListener.java:58)
         at weblogic.application.internal.flow.BaseLifecycleFlow$PostStartAction.run(BaseLifecycleFlow.java:209)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.application.internal.flow.BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:95)
         at weblogic.application.internal.flow.BaseLifecycleFlow.postStart(BaseLifecycleFlow.java:62)
         at weblogic.application.internal.flow.TailLifecycleFlow.activate(TailLifecycleFlow.java:33)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:641)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:229)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
         at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:181)
         at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:352)
         at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:52)
         at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:186)
         at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
         at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
         at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
         at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
         at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
         at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
         at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

    Thanks Sharat. Can you please specify more details about the class / jar you are talking about? What Jar do you think is duplicated? I verified the classpath and the jars in the server/lib and web-inf/lib. Everything seems ok to me.
    Your input will be highly appreciated.

  • Runtime Error: java.lang.ClassCastException

    My project is to creat a postfix with boolean. I finished my code, it compiled great, than I got an java.lang.ClassCastException. So obviously I have a casting problem. Any help or hints in the right direction would be greatly appreciated.
         import java.util.*;    
    import javax.swing.*;
    public class KimbelPostfix
        public static void main(String[] args)
         String expression;
         String token;
         String operator;
         String myString = "true";
         StringTokenizer tokens;
         Boolean operand1, operand2, result = true;
         //create empty stack of pending boolean operands
         Stack operandStack = new Stack(); 
         expression = JOptionPane.showInputDialog( "Enter postfix expression" );
         tokens = new StringTokenizer(expression);
         while (tokens.hasMoreTokens())
             token = tokens.nextToken();
             if (!isOperator(token))   //operand
                 new Boolean(myString);
                 myString = token;
                 operandStack.push(token); 
             //  printStack(operandStack);   //display stack at each step. Debugging
             else
             {   //token is an operator
                 //pop two booleans off stack.
                 //convert popped Object to boolean, extract boolean
                 operand2 = ((Boolean)operandStack.pop()).booleanValue();
                 operand1 = ((Boolean)operandStack.pop()).booleanValue();  //"first" one
              if (token.equals("!"))
                  operandStack.push(token);
                  result = operand1 && !operand2;
              else if (token.equals("&&"))
                  result = operand1 && operand2;
              else if (token.equals("||"))
                  result = operand1 || operand2;
              operandStack.push(new Boolean(result)); 
         //only object in stack is the answer
         result =  ((Boolean)operandStack.pop()).booleanValue();
         JOptionPane.showMessageDialog(null,expression+" = "+result);
         System.exit(0);
        static boolean isOperator(String t) {
             if (t.equals("!") || t.equals("&&") || t.equals("||"))
                 return true;
             else
                 return false;
        static void printStack( Stack s)
         System.out.print("Stack is: ");
            Iterator items = s.iterator();
            while (items.hasNext())
            System.out.print(items.next()+"  ");
            System.out.println();
         

    When I run the program and enter "false false ||" I get the slightly more useful error message:
    Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean\\     at KimbelPostfix.main(KimbelPostfix.java:38)Now line 38 is the one in the else part of the while loop, that says:operand2 = ((Boolean)operandStack.pop()).booleanValue();Evidently what you were casting to a Boolean - operandStack.pop() - is a String. And you can't cast Strings to Booleans like that. So the questions are "what were you expecting to be on the stack?" and "what was actually on the stack?".
    You already have a method that will help answer the second question. As regards the first, if you were expecting a Boolean on the stack you had better go back to whereever you push things onto the stack and see why it's a String not a Boolean.
    Edited by: pbrockway2 on Dec 17, 2007 2:05 PM
    I've just read the edit of your last post, and I agree with petes1234. No-one here is going to write the code for you. That's not trying to be discouraging or dismissive: just saying how things are.
    There are signs of dispair in the myString variable, and the way you (attempt to) handle the unary ! operator. If you're tired and "fiddling around" to no productive effect your best bet would be to step away from the computer and do something else for a few hours.

  • ALC-WKS-007-027 error - java.lang.ClassCastException

    Hi
    I've seen a few references to this error on the forums but I have encountered a variation that does not appear to be covered.
    When I try invoking a process from workspace I get the error dialog showing the ALC-WKS-007-027 error and when I look at my server.log file I get the following ...
    2008-03-26 15:27:44,317 INFO [STDOUT] [Flex] Error handling message: flex.messaging.MessageException: java.lang.ClassCastException : com.adobe.idp.scheduler.trigger.OneShotTrigger cannot be cast to com.adobe.idp.scheduler.trigger.Trigger
    incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
    operation = invoke
    clientId = D771AC36-FB09-CA71-D0D1-F3933CAD9B8D
    destination = endpoint-actions
    messageId = 6A6CEC1E-3103-1BAB-4147-EBB3AE15E9E4
    timestamp = 1206545264171
    timeToLive = 1206545264171
    body = null
    hdr(DSId) = D769E5BE-6F1A-4150-02DE-30CB8A7E165F
    hdr(DSEndpoint) = workspace-polling-amf
    errorReply: Flex Message (flex.messaging.messages.ErrorMessage)
    clientId = D771AC36-FB09-CA71-D0D1-F3933CAD9B8D
    correlationId = 6A6CEC1E-3103-1BAB-4147-EBB3AE15E9E4
    destination = endpoint-actions
    messageId = D771AD9B-6D08-049A-4CD0-81A25E061B3B
    timestamp = 1206545264317
    timeToLive = 0
    body = null
    code = Server.Processing
    message = java.lang.ClassCastException : com.adobe.idp.scheduler.trigger.OneShotTrigger cannot be cast to com.adobe.idp.scheduler.trigger.Trigger
    details = null
    rootCause = java.lang.ClassCastException: com.adobe.idp.scheduler.trigger.OneShotTrigger cannot be cast to com.adobe.idp.scheduler.trigger.Trigger
    body = null
    extendedData = null
    I have just upgraded to service pack 2 of LiveCycle ES.
    I'd really appreciate some help on this.
    Thanks
    Bernard

    send me your process lca
    [email protected], will take a look at your problem

  • Error: java.lang.ClassCastException: java.util.Arrays$ArrayList

    Hi,
    How to solve this error?
    I get the error at this line of code in my program.
    java.util.ArrayList list= (java.util.ArrayList)obj;
    Please help how to solve this problem.
    Thanks,
    cmbl

    cmbl wrote:
    How to solve this error?
    I get the error at this line of code in my program.
    java.util.ArrayList list= (java.util.ArrayList)obj; Don't do this cast.
    Why are you doing this cast anyway? I think you need to show a small bit of compilable code (or almost compilable except perhaps for this error) and some more explanation.

  • Help with java.lang.ClassCastException in JSSE

    I need an urgent help.
    i am writing code in JSSE for getting Server certificater(through SSL)
    i wrote
    public class url
    public static void main(String[] args)
    try
    System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
    Security.addProvider(new Provider());
    URL url=new URL("https://localhost:8443");
    HttpsURLConenction urlc=(HttpsURLConnection) url.openConnection();
    catch(Exception e)
    System.out.println(e);
    when i am executing this programing, i am getting the following run time error
    java.lang.ClassCastException
    I think i am getting error for the following line of code
    " HttpsURLConenction urlc=(HttpsURLConnection)url.openConnection(); "
    Please help me out to overcome this run time error.
    I would be grateful to you if you can solve my error

    Hi all
    I have the same error:
    java.lang.ClassCastException: com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
    MY CODE IS:
    // Set the system and security properties
                   System.setProperty("javax.net.ssl.trustStore",
                             "C:\\certificados\\cacerts");
                   System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
                   // Keystore location and password
                   System.setProperty("javax.net.ssl.keyStore",
                             "C:\\certificados\\keystore");
                   System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
    //Set the request
    String url_ = "https://195.235.160.165";
    //Creamos la petici�n html
    StringBuffer buffer = new StringBuffer();
    buffer.append(url_);
    buffer.append("/GPP/WLServer?Method=M_FINDIT&CLIENT=");
    buffer.append(client);
    buffer.append("&CLI_PASSWD=");
    buffer.append(cli_passwd);
    buffer.append("&USER=");
    buffer.append(user_login);
    buffer.append("&USER_PASSWD=");
    buffer.append(user_passwd);
    buffer.append("&TUSERID=");
    buffer.append(MSISDN);
    buffer.append("&TUSERID_TYPE=MSISDN");
    buffer.append("&GROUP=");
    buffer.append(group_id);
    buffer.append("&SRS=GPP:UTM28");
    url_ = buffer.toString();
    URL url = new URL(url_);
    HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
    conn.setHostnameVerifier(new HostnameVerifier() {
    public boolean verify(String hostname, SSLSession session)
    // I don't care if the certificate doesn't match host name
    return true;
    BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        conn.getInputStream()));
    //Creates a writer with the encoding parameter as "UTF-8"
    Writer out_ = new OutputStreamWriter(response.getOutputStream(), "UTF-8" );
    String inputLine;
         String fichero_in = "";
         while ((inputLine = in.readLine()) != null){               
         if(inputLine.length()!=0){
              System.out.println(inputLine);
              fichero_in = inputLine;
              out_.write(inputLine);
         in.close();
    //Sets the Content-Type header
    response.setContentType("application/xml; charset=utf-8");
         //response.setContentType("text/html; charset=UTF-8");
    //Sends the response XML to the client
    out_.write(url_);
    //out_.write(fichero_in);
    out_.flush();
    response.sendRedirect(response.encodeRedirectURL("out_"));
    Anyone can hel me??
    Thanks in advance

  • Java.lang.ClassCastException while creating array descriptor

    ( This post was moved from SQL / PLSQL forum to here )
    Hi everyone, i used to pass string array from java to plsql. I wrote a java source, then i load db with loadjava. And i wrote java spec. Then i run the function but i am getting this error :
    java.lang.ClassCastException
    at oracle.jdbc.driver.PhysicalConnection.putDescriptor(PhysicalConnection.java:4921)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:208)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:175)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:158)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:125)
    at SplitterOracle3.tokens2(SplitterOracle3.java:29)
    My Java Source is :
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import oracle.sql.*;
    import oracle.jdbc.driver.OracleConnection;
    import oracle.jdbc.driver.OracleDriver;
    public class SplitterOracle3 {
    public static oracle.sql.ARRAY tokens2(String str,String delim)
    try
    //Class.forName("oracle.jdbc.driver.OracleDriver");
    //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //Connection conn = new OracleDriver().defaultConnection( );
    OracleDriver ora = new OracleDriver();
    OracleConnection conn = (OracleConnection) ora.defaultConnection();
    //ArrayDescriptor arrayDesc = ArrayDescriptor.createDescriptor("MY_ARRAY", ((conn).getRealConnection());
    //Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    //Connection conn = ((DelegatingConnection) getDataSource().getConnection()).getInnermostDelegate();
    // get an initial context
    //OracleConnection oracleConnection = (OracleConnection)WSJdbcUtil.getNativeConnection((WSJdbcConnection) wsConn);
    ArrayDescriptor arraydesc =
    ArrayDescriptor.createDescriptor ("ARR_VARCHAR_100", conn);
    String strarr[] = new String[47];
    strarr[0]="ahmet";
    strarr[1]="mehmet";
    int curIndex = 0;
    int nextIndex = 0;
    boolean nextIsLastToken = false;
    int i=0;
    while (true)
    nextIndex = str.indexOf(delim, curIndex);
    if (nextIsLastToken)
    //return false;
    break;
    if (nextIndex == -1)
    nextIsLastToken=true;
    nextIndex = str.length();
    strarr[i] = str.substring(curIndex, nextIndex);
    curIndex = nextIndex + 1;
    i++;
    ARRAY dirArray = new ARRAY(arraydesc, conn, strarr);
    return dirArray;*/
    catch(Exception ex)
    System.err.println(ex.getMessage());
    ex.printStackTrace();
    return null;
    public static void main(String[] args)
    String str="2000,2,123553168,1,10,64895,65535,27662,64860,64895,65535,27662,64860,0,,,,,,0,0,2491039806,,,,,,,,,0,0,1,,2491039106,,,,,,,,,,,,";
    String strarr[] = new String[47];
    long l1,l2;
    int j=0;
    l1 = System.currentTimeMillis();
    for ( int i=0; i<20000000; i++)
    strarr = tokens2(str,",");
    l2 = System.currentTimeMillis();
    System.out.println("Fark :"+ (l2-l1));
    The line has "ArrayDescriptor.createDescriptor ("ARR_VARCHAR_100", conn);" causes this error.
    java.lang.ClassCastException
    at oracle.jdbc.driver.PhysicalConnection.putDescriptor(PhysicalConnection.java:4921)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:208)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:175)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:158)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:125)
    at SplitterOracle3.tokens2(SplitterOracle3.java:29)
    But i could not find the solution. Can you help me?
    Thanks for responses.

    Hi,
    Did you try my suggestion from Re: java.lang.ClassCastException while create array descriptor
    Try replacing
    oracle.jdbc.driver.OracleConnectionwith
    oracle.jdbc.OracleConnectionRegards
    Peter

  • Struts Application java.lang.ClassCastException

    We have deployed struts1.2.1 application on Oracle Application server 10g
    We are getting inconsistent error java.lang.ClassCastException pointing to struts html:form tag once the server restarts the exception is removed this is happening at runtime.
    Since this is a production issue its very critical .If any one has faced similar issue Please provide the solution.

    Take a look at the stack trace, it shows you exactly where the error is coming from:
    java.lang.ClassCastException: org.theclass.candidate.view.SearchForm
    org.theclass.candidate.view.CandidateListAction.execute(CandidateListAction.java:41)Line 41 in your CandidateListAction.
    Probably it is failing on a cast of your action form.
    Taking a closer look at your struts-config, you are "chaining" actions.
    Your AddCandidateAction uses the candidateForm, and forwards to CandidateListAction.do
    Your CandidateListAction uses the searchForm.
    That will be the cause of your class cast exception.
    <action path="/Add"
      name="candidateForm"
      type="org.theclass.candidate.view.AddCandidateAction"
      validate ="true"
      input="/jsp/addcandidate.jsp">
      <forward name="success" path="/CandidateList.do"/>
    </action>
    <action path="/CandidateList"
    type="org.theclass.candidate.view.CandidateListAction"
    name="searchForm"
    scope="request" >
    <forward name="failure" path="/jsp/list.jsp"/>
    <forward name="success" path="/jsp/candidatelist.jsp"/>
    </action>Check out: http://struts.apache.org/1.x/faqs/newbie.html#chaining
    Solutions?
    - don't chain actions ;-)
    - use the same action form for both actions (possible?)
    - make the actionForward a "redirect" one. That means a new request, and losing any request parameters/attributes but should prevent this class cast exception.
    Hope this helps,
    evnafets

  • Java.lang.ClassCastException: org.apache.crimson.tree.XmlDocument

    Hi all,
    i am new to java. I am trying to parse an xml document. the code is as follows:-
    Document document = null;
    DocumentBuilderFactory factory = ocumentBuilderFactory.newInstance();
    try {
         DocumentBuilder builder = factory.newDocumentBuilder();
         document = builder.parse( new File(xmlFile) );
    after this i am trying to traverse using treewalker :-
    Element docElem = document.getDocumentElement();
                   DocumentTraversal docTrav = (DocumentTraversal) document;
                   TreeWalker treeWalk = docTrav.createTreeWalker(docElem, NodeFilter.SHOW_ELEMENT, new ConfigNodeFilter(), false);
              Node node = treeWalk.nextNode();
    when i compile all is fine but while runnig it. i get the following error:-
    java.lang.ClassCastException: org.apache.crimson.tree.XmlDocument
    at - DocumentTraversal docTrav = (DocumentTraversal) document;.
    my import statements are as follows:-
    import java.io.File;
    import java.io.IOException;
    import java.net.InetAddress;
    import java.net.UnknownHostException;
    import java.util.Vector;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.traversal.DocumentTraversal;
    import org.w3c.dom.traversal.NodeFilter;
    import org.w3c.dom.traversal.TreeWalker;
    import org.xml.sax.SAXException;
    i am not able to understand why the error is coming.
    any help will be appreciated.

    "In DOMs which support the Traversal feature, DocumentTraversal will be implemented by the same objects that implement the Document interface. "
    My guess is that the DOM parser you are using doesn't support the DocumentTraversal interface which is why you can not cast to that class.

  • Java.lang.ClassCastException in WebDynpro Java

    Hi,
    I am new to Adobe Interactive Forms.
    I made the visual admin settings and binded both contexts (pdfsource and datasource).
    But when i deploy the application i get an error.
    java.lang.ClassCastException
        at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.InteractiveForm.modifyDataType(InteractiveForm.java:861)
        at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.InteractiveForm.afterHandleActionEvent(InteractiveForm.java:347)
        at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.afterApplicationModification(ClientApplication.java:1132)
        at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.afterApplicationModification(ClientComponent.java:887)
        at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doRespond(WindowPhaseModel.java:573)
        ... 26 more

    hi,
    This is the error if i bind it to a binary variable
    com.sap.tc.webdynpro.services.exceptions.PDFDocumentCreationException: ../../local/interactiveforms/App_test/~wd_key0_1207308638688/Error+PDF.pdf;jsessionid=(J2EE3598700)ID1354246350DB01492923852963931389End;saplb_*=(J2EE3598700)3598750?sap-wd-download=1&sap-wd-dl_behaviour=1&sap-wd-cltwndid=8c066151023a11ddb5b8001a4dd89852&sap-wd-appwndid=8c066152023a11dd8709001a4dd89852&sap-wd-norefresh=X
        at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.InteractiveForm.afterHandleActionEvent(InteractiveForm.java:383)
        at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.afterApplicationModification(ClientApplication.java:1132)
        at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.afterApplicationModification(ClientComponent.java:887)
        at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doRespond(WindowPhaseModel.java:573)
        at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:152)
        ... 25 more

  • Java.lang.ClassCastException in FOTable while inserting fo:table-row

    Hi
    Template Builder of in word was throwing error 'java.lang.ClassCastException:oracle.apps.xdo.template.fo.elements.table.FOTable'.This error comes whenever i introduce <fo:table-row> tag.
    I am using XML Desktop Pubisher 5.5 Build Version
    Please help me out.
    Thanks
    Darshan

    Sorry for the trouble . I have found out the solution
    So this thread can be closed.
    Thanks
    Darshan

Maybe you are looking for

  • I have a Mac OS X 10.6.8 and want to upgrade to OS X Yosemite, but will I lose my purchased programs?

    I have a Mac OS X 10.6.8 and want to upgrade to OS X Yosemite, but will I lose my purchased programs as I have a student version of the creative suite that will cancel itself if I try to reinstall it? Thanks in advance

  • I've been stealing my own itunes

    Hello! Sorry for bad English. in the evening on Sunday, a brief summary of the 17 month of August I have to give my friend my own and I've had to change the PIN number and all the information related to the original account .. I am in desperate need

  • OSX RDP v8.0.24308 Default Resolution/No Fullscreen for new connections

    I would like to set defaults so that any new connection I create always are set to No Fullscreen, a specific Resolution, and a specif Color-Depth.  I should not have to change this for all new connections.

  • Question about B2C Web Shop

    Hello, On http://help.sap.com, it is mentioned that “On the General Information tab page in Shop Management the system administrator enters the reference user ID in the Reference User field.” But in my shopadmin I don't see “Reference User” field. An

  • Project Server 2010 Adding attachments to PDP

    Is there a way for a user to attach documents to a PDP?  I understand that in SharePoint you can add attach documents to a list.  How would I combine the two?  Thanks! David L. Crooks