Another ClassCast Exception!!
Hi,
I waded though the earlier classcast exception discussions and felt that
my case was slightly different so here it goes
I am using Weblogic Server v 4.51.
I have my application servlets in a jar file which is included in the
servlet classpath in the weblogic.properties file.It is not in the
system classpath.
I have two scenarios which fail with identical exceptions.
I have one servlet which on one type of request stores an object into
the session
and on another type of request retrieves it from the session.This object
is of a type which we have created ChartHTML and is in a jar file which
is also in the servlet classpath.When I retrieve the ChartHTML object
from the session it throws a classcast exception.The code line is as
follows
ChartHTML = (ChartHTML) session.getValue("chart");
I am not trying to change any classes in midsession or anything.I am
able to
get other values previously stored in the session but they are plain
java Strings.
This has worked for months under JRun.
Any help will be appreciated
Santosh
It could be in retreiving from the DB? If you have a binary type that you are storing text in, sometimes a class cast exception is thrown (though not always) if you try and push that straight into a String ie String s = resultSet.getString("actuallyABinaryFied");
It also depends on the DB and drivers you are using. My experience of this is with mySql and mm drivers
Just a thought...
Similar Messages
-
EJB 3.0 JNDI lookup results in Classcast Exception
Hello everybody,
I�m experiencing a strange problem when I want to retrieve a stateless session bean from a POJO in my enterprise app. I am using EJB 3.0, running on Glassfish build 33 and JDK 1.5.
I have successfully deployed my ear file which has the EJB.jar and the war file in it. I�m using JSF 1.2 in the web app and I am able to use all session beans using the injection annotation in my managed beans (this is how it is supposed to be according to the spec.). However, I now need to acces a stateless session bean from a POJO (non-managed or backing bean) which resides also in the war file. I�m using the following code to retrieve the session bean:
(where IMySessionBean = remote interface and MySessionBean is the implementation)
try {
ic = new InitialContext();
MySessionBean mybean = (MySessionBean )ic.lookup("env/IMySessionBean");
When casting the object from the lookup into MySessionBean I get a classcast Exception. However, I can see the session bean using the JNDI browser that comes with Glassfish and it�s deployed and available. If mybean is of type Object, I see that the lookup method returns a wrapper of my session bean.
Here�s what the stacktrace says:
java.lang.ClassCastException: com.myproject.ejb.interfaces._IMySessionBean_Wrapper
at ...
Do I miss something here and there�s more required to obtain a reference to the session bean? I�m pretty much stuck here and any help is greastly appreciated!
Thanks in advance!
Cheers,
JoergHi Joerg,
In the session bean client view, the bean implementation class is never used. The client
only interacts with the local or remote interface.
Regarding the lookup, the more portable approach is to
lookup the ejb reference through the component environment of the web application
rather than doing a direct global lookup. If you have already defined any ejb reference
injections somewhere in the web app, you can look up the same dependencies via
java:comp/env. For example, if your managed bean has the following @EJB annotation :
@EJB(name="mybeanref") IMySessionBean beanRef;
You can look up the same underlying dependency in your utility class :
IMySessionBean beanRef = (IMySessionBean) new InitialContext().lookup
("java:comp/env/mybeanref");
Note that the portion of the lookup string after java:comp/env/ comes from the name() attribute
of @EJB. @EJB name() has the same semantics as the ejb-ref-name in the deployment
descriptor. You can find more info on these topics in our EJB FAQ :
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html -
Random classcast exception - com.sun.jndi.cosnaming.CNCtxFactory
Hi,
I am trying to use a remote ejb (weblogic 8.1.5/ jdk 14) from a j2se 1.5 rmi-iiop client.
If I use com.sun.jndi.cosnaming.CNCtxFactory to look up the remote home & then use the remote interface, I get the following error RANDOMly (i.e only some calls succeed).
java.lang.ClassCastException
at xxx.equals(xxxjava:129)
at weblogic.corba.utils.IndirectionValueHashtable.get(IndirectionValueHashtable.java:119)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1471)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1593)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1593)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
at weblogic.iiop.RMIMsgOutput.writeObject(RMIMsgOutput.java:117)
at xxx.yyy_ehqjge_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:492)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:435)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:430)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
I had a look at IndirectionValueHashtable class. It looks like the classcast is happening because the "handle-to-object" map has non String values.
Could this be a corba compatabilty issue?
The problem doesn't occur if I use weblogic initial context factory & t3 protocol.
What is the best way to overcome this problem? I dont want to distribute weblogic.jar [from 8.1.5 server]. wlclient is okay.
thanksTony Zimmer <> writes:
Certainly looks like a bug, in which case you need to go through
support to get it fixed. Do however check that your objects are in
fact serializable (including all their fields).
andy
Tried a few more combinations. No luck so far.
classcast exception for some objects at some times
server: WebLogic Server 10.0 / Sun 1.5.0_06/ WinNT 6
client: Sun jdk 1.5.0_11/1.4.2_14
java.lang.ClassCastException: java.lang.String
at xxxpack.client.PaymentReceipt.equals(PaymentReceipt.java:881)
at weblogic.corba.utils.IndirectionValueHashtable.get(IndirectionValueHashtable.java:119)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1836)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1992)
at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2253)
at weblogic.utils.io.ObjectStreamClass.writeFields(ObjectStreamClass.java:413)
at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:235)
at weblogic.corba.utils.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:182)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1957)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1992)
at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2253)
at weblogic.utils.io.ObjectStreamClass.writeFields(ObjectStreamClass.java:413)
at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:235)
at weblogic.corba.utils.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:182)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1957)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1992)
at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2253)
at xxxpack.server.ProcessPayment_ehqjge_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:479)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:475)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:59)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:1016)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
server: WebLogic Server 8.1 SP6 / Sun 1.4.2_11 / WinNT 6
client jdk 1.4.2_14/1.5.0_11:
java.lang.ClassCastException
at xxxpack.client.PurchaseAmount.equals(PurchaseAmount.java:148)
at weblogic.corba.utils.IndirectionValueHashtable.get(IndirectionValueHashtable.java:119)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1471)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1593)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1593)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
at weblogic.iiop.RMIMsgOutput.writeObject(RMIMsgOutput.java:117)
at xxxpack.server.ProcessPayment_ehqjge_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:491)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:120)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
Do you have a list/ martix of client-server versions used for the bug fixes?
Thanks -
Why do i get classcast exception for this code
import java.util.*;
public class Test1{
public static void main(String a[]){
Set s = new TreeSet();
s.add(new Person(20));
s.add(new Person(10));
System.out.println(s);
class Person{
Person(int i){}
}basically classcast exception is thrown when the class can not be casted with the proper form that is demanded.
1> in case of set the value should be mutually comparable. but unfortunately in you code you have not implemented comparable interface. you should implement that interface.
2> after using the comparable interface you should implement the method <class object 1>.compateTo(<class object 2>)
the above two process should exclude the exception from you code hopefully.
check out! -
DropdownByKey UI element is giving Classcast exception
Hi
In my webdynpro view if i add "DropdownbyKey" UI element and the run the application,it is giving Classcast Exception.i am getting following error
The initial exception that caused the request to fail, was:
java.lang.ClassCastException
at com.sap.tc.webdynpro.progmodel.context.Paths.getAttributeInfoFor(Paths.java:202)
at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.DropDownByKeyAdapter.setViewAndNodeElement(DropDownByKeyAdapter.java:240)
at com.sap.tc.webdynpro.clientimpl.html.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:231)
at com.sap.tc.webdynpro.clientimpl.html.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:64)
at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.FlowLayoutAdapter$Items.getControl(FlowLayoutAdapter.java:318)
... 39 more
Please help
thanks
PrasadHi Sriram,
You need to bind the property "selectedKey" for the DropdownByKey UIElement
http://help.sap.com/saphelp_nw04/helpdata/en/08/13dbfb6e779743bb2ca641ebcb3411/frameset.htm
Regards, Anilkumar -
If I make update to my apps, it needs a password for another Apple ID. I want to delete all another IDs except my ID in my iPad device, how?
Tap Settings > General > Reset > Reset All Settings
Same reset helped here > https://discussions.apple.com/message/20016074#20016074
Hopefully it will work for you. -
Classcast exceptions when persistence units deployed as shared libraries
Hi
We are using weblogic 10.3.3 & eclipse link 2.0 persistent units:
We have uim-entities.jar(persistent unit) under uim-core-lib.ear(/APP-INF/lib) that is deployed as a shared library. We have multiple applications(ears) referring to this shared library (same persistent name, "default") using lib-ref in weblogic-application.xml. We are facing issue while deploying and running the application.(Primarily classcast exceptions on log4j classes and entity DAOs). If the persistent unit is replication in each app's APP-INF/lib, we are not seeing those exceptions.
Are there any known issues in using persistent units as shared libraries.
Pasting the exception for your reference:
log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender
at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:238)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:171)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:184)
at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:502)
at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:415)
at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:919)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:790)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:682)
at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:811)
at oracle.communications.inventory.api.framework.logging.LogFactory.<clinit>(LogFactory.java:176)
at oracle.communications.inventory.api.framework.listener.InventoryEntityLifeCycleEventListener.<clinit>(InventoryEntityLifeCycleEventListener.java:36)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:88)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListenerMetadata.getClassForName(EntityListenerMetadata.java:158)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListenerMetadata.process(EntityListenerMetadata.java:311)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.processEntityListeners(MappedSuperclassAccessor.java:796)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processListeners(EntityAccessor.java:1064)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.addEntityListeners(MetadataProcessor.java:104)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:327)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:151)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:207)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:195
Thanks,
MuraliMurali,
Hi, the CCE for Apache Log4J is outside of the scope of JPA - i have not see the "oracle.communications.inventory.api.framework.logging" package in play before - what kind of connection factory are you using or are you using JTA?
Note: WebLogic 10.3.4.0 has been upgraded to enable container managed persistence context injection and no longer requires the use of shared libraries. See the wiki post...
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#Enabling_JPA2_support
For WebLogic 10.3.3.0 and JPA 2.0 usage as application managed libraries using the <wls:prefer-application-packages/> weblogic-application.xml tag see the wiki post...
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#DI_1.1:_Alternative_3:_Application_Level_Shared_Library_-InUse
thank you
/Michael O'Brien
http://www.eclipselink.org -
BC4J using Tomcat DataSource: ClassCast Exception
Hi
need help with this problem:
i have deployed a bc4j module to tomcat.
the module is confgured to use an excisting datasource within the servlets context.
everything works fine, like
o ApplicationModule is created (using the correct Datasource on Tomcat)
o a ViewObject is looked up by name
but here it starts to get messy:
executing the a query on the ViewObject leads to a ClassCast Exception (see below)
One additional remark:
The same code works fine, when using a Connection instead of a DataSource.
But this is J2EE, so why not use a DataSource ?
Thanks for any ideas
Volker
java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingPreparedStatement
at oracle.jbo.server.OracleSQLBuilderImpl.doStatementSetRowPrefetch(OracleSQLBuilderImpl.java:976)
at oracle.jbo.server.DBTransactionImpl.createPreparedStatement(DBTransactionImpl.java:3346)
at oracle.jbo.server.DBTransactionImpl2.createPreparedStatement(DBTransactionImpl2.java:425)
at oracle.jbo.server.DBTransactionImpl.createReUsePreparedStatement(DBTransactionImpl.java:4173)
at oracle.jbo.server.ViewObjectImpl.getPreparedStatement(ViewObjectImpl.java:7750)
at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:586)
at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:547)
at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3422)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:663)
at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:769)
at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:706)
at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3363)
at de.mtag.demo.server.Demo.start(Demo.java:88)I know it´s been a long time since you've posted this question. But did you resolve this problem ? I'm having the exact same situation here.
Any help would be good.
Thanks a lot,
John -
Classcast exception while sending objects to the server
I'm getting classcast exception when i try to send objects from the java webstart application at the client side to a server. Its working fine if I do the same without using javaweb start. I'm using hessian client to send objects to the server.
I've a web app that gets outlook contacts from the client machine and send those to the server. I'm sending these contacts as custom objects(OutlookContact) to the server using hessian client. But these objects are being sent to the server as String objects but not as OutlookContact objects. I don't know whats happening. Can anyone please tell me is there any setting that I need to set in the jnlp file.
thanks,
JayaramI am also getting the same error. Please anybody can help
-
I have been trying to pair my 8100 with my new 2008 model BMW 135i built in car kit using Bluetooth set up. The phone finds the car kit and the two appear to pair (confirmation numbers entered etc) but then the Smartphone screen freezes and the following error message appears 'Uncaught exception: java.lang.Classcast Exception'. The phone cannot then receive or make calls (won't even turn off until battery removed). Have been through the whole process several times. The car will pair with other phones and my 8100 will pair OK with other devices. Can anyone help?
Thanks, Paul.I have got aorund the problem by disabling address book transfer. I can now receive calls and make outgoing calls by either dialling on the blackberry itself or using the BMW idrive controller. It is better than nothing and my main use anyway is for incoming calls while driving. The whole idea of the integrated system was to be able to scroll through the address book on the steering wheel buttons and view the address book entries on the satnav screen.
I have had similar problems in the past with an integrated system in a Porsche. The Blackberry never establised bluetooth contact with that system at all. -
ClassCast Exception during EJB lookup
Context ctx = new InitialContext();
Object ref = ctx.lookup("MessageSender");
SenderHome senderHome= (SenderHome)PortableRemoteObject.narrow(ref,SenderHome.class);
sender = senderHome.createSender();
where MessageSender is the JNDI name of bean.
The error is ::
java.lang.ClassCastException: com.sap.message.sender.SenderHome#
I have even tried SenderHome senderHome = (SenderHome)ref
bcos SenderHome is locally deployed. I have also tried with SenderLocalHome ,but it also gives ClassCast Exception.
Message was edited by:
Shilpa BhanotHi,
Have you tried to find out what the class actually is ?
<code>
Context ctx = new InitialContext();
Object ref = ctx.lookup("MessageSender");
Object objUnknown= PortableRemoteObject.narrow(ref,SenderHome.class);
System.out.println ("Class of object is :" +objUnknown.getClass());
</code> -
Beta version of Weblogic 6.0 and classcast exception error.
As an FYI to those who have be receiving the "dreaded" classcast
exception error, the new version of Weblogic seems to fix the problem.
It took me awhile to figure out how th deploy the web application, but
once I did the application seemed to work w/o a problem (and w/o the
error).
Paul Garduno
We do not offer a JDBC driver for Linux in version 5.1. In version 6.0,we
do offer a type 4 driver for Linux.
In version 5.1, I suggest trying the platform independent type 4 JDBC driver
available for free from Oracle. It is supported (as is any JDBC driver)
with WebLogic Server. To download it:
Go to http://www.oracle.com and select the "Download" option.
From the resulting page, use the "Select Utility or Driver" dropdown to
select Oracle JDBC drivers
From the resulting page, scroll down a little (since SQLJ stuff appears at
the top).
Or, to go directly there:
http://technet.oracle.com/software/tech/java/sqlj_jdbc/software_index.htm
Thanks,
Michael
Michael Girdley, BEA Systems Inc
Learning WebLogic? Buy the book.
http://www.learnweblogic.com/
"Michael W. Warren, Sr." <[email protected]> wrote in message
news:[email protected]..
I have installed WebLogic 6.0 on Solaris platform and verified that the
server comes up
and that I can connect to it via Netscape. Next step was to verify
installation of WebLogic
jDriver for Oracle. When I run the following:
java utils.dbping ORACLE scott tiger
I get the following error:
Starting Loading jDriver/Oracle .....
Error encountered:
java.sql.SQLException: System.loadLibrary threw
java.lang.UnsatisfiedLinkError
with the message
'/ldatae/bea/wlserver6.0/lib/solaris/oci816_8/libweblogicoci37.so:
ld.so.1: /ldatae/bea/jdk130/jre/bin/../bin/sparc/native_threads/java:
fatal: libgen.so.1: open failed: No such file or directory'.
at
weblogic.jdbcbase.oci.Driver.loadLibraryIfNeeded(Driver.java:202)
at weblogic.jdbcbase.oci.Driver.connect(Driver.java:57)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:182)
Anyone seen this? Help!!!
Thanks in advance
Mike Warren, Sr.
[email protected] -
we are seeing a strange error in server logs .
Scenario
'Interface1' is implemented by 'Class1' . 'Class2' extends 'Class1'
Issue
statement : Interface1 intf = (Interface1) Map.get(<KEY>) throws classcast exception
Stack-trace shows that the class it found is 'Class2'
java.lang.ClassCastException:
Class2
What could be the possible cause here ?.Issue due to Classloading?. Can this happen if 'Class2' is loaded by one classloader ( child ) and 'Interface1' is loaded by parent classloader?
Thanks
Josephjcgeorge wrote:
Issue due to Classloading?. Can this happen if 'Class2' is loaded by one classloader ( child ) and 'Interface1' is loaded by parent classloader?Yes, for example if the child classloader doesn't delegate to its parent classloader and the interface and class are loaded by different classloaders. -
Classcast exception which getting the ISendMailService instance.
Hi all,
I am getting classcast exception at the below line.
ISendMailService sendMailSvc = ResourceFactory.getInstance().getServiceFactory().getService(ISendMailService.SERVICE_ID);
Any clue.?? It was working fine. but suddenly getting this exception.
Regards,
SviaHi I have a WD with the same problem. I posted a thread
https://www.sdn.sap.com/irj/sdn/thread?threadID=117080
do you find any solution to this problem? -
ClassCast Exception when trying to cast a getApplet() call.
I have a quick question abotu Applet Contexts.
I have an applet that tries to get the context of another applet on
the same page. The following is a sample of what I'm doing:
try {
TestApplet app =
(TestApplet)getAppletContext().getApplet("test");
catch (Exception err) {
err.printStacjTrace();
The above gives me a ClassCastException error. Yet if I remove the
cast and just get do the following:
Applet app = getAppletContext().getApplet("test");
I actually get a hold of it and when I examine the class name of app,
it is TestApplet.
But if I try to cast it, I get the same error (i.e. (TestApplet)app).
I have tried the above approches as well a variation of the parenthesis grouping, i.e.:
TestApplet app = (TestApplet)(getAppletContext().getApplet("test"));
or
Applet app = getAppletContext().getApplet("test");
((TestApplet)app).methodCall();
and they all give me the same result.
Does anyone have any ideas as to how to resolve this issue? Any hints
or help will be greatly appreciated.
Jorge Fraser.I'm almost willing to bet that the two Applets are loaded from different ClassLoaders.
If two Applets are on the same page, but they have different lists of required classes, then for some wacky reason they seem to load in different ClassLoaders.
If two applets load from different classloaders, then even if they are in the same JVM, you cannot cast one to the other.
You can test this by calling applet.getClass().getClassLoader(), and printing the value out just to see if they're the same reference.
If this is indeed your problem, then this is a major pain for you, and you'll need to cheat by putting the same list of classes in both applets.
This happened to us, and I won't go into gory details but we had an applet using JARs A, B and C, and another applet using JARs A, D and E, and needed a third applet which could take screenshots of the other two. As a result we had to make all three applets use all five JARs, and there was no way to stop this. (Even using a static method to register each applet falls down, because the static contexts are different in the two classloaders.)
Maybe you are looking for
-
Hyper v replica for multiple sites
Hi I support 3 sites and would like two of them running hyper v to replicate back to the same replica site and server. Is this possible to have two hyper v sites replicate back to the same server based at another location or do they require their own
-
Check for spaces embedded with in a field
Hi, I need to check for spaces in a field. The field is char(8). I need to check for spaces in between. Example: ' 1 2' '1 2' ' 12' Leading spaces and spaces between the chars. the spaces can be more than 1. Is this possible in just SQL?
-
Hi everyone, I have an issue ,at any transaction ex miro or mmo1 or me22n and other ,after saving a message line in down left was appearing showing documents number .Now I don't see that message every time I save atransaction.I believe that is qu
-
Does anyone know if there is a way in LPX to show the content of the aliases in the main window, but also in the Piano Roll. If I create a midi region and an alias: - The main window shows a mini piano roll for the main region but not for the content
-
Downloaded "Rush" yesterday on my iPad2 - sat down to watch it today. 1.23 seconds in, I get error message "cannot load video" Most annoying! Not happened before. Please ether fix or give me my money back asap Jody