ClassCastException while instantiate HttpsURLConnection
When I try to instantiate an HttpsURLConnection from an URL instance called "Server,"
HttpsURLConnection conn =(HttpsURLConnection) server.openConnection();I got the following exception:
java.lang.ClassCastException: sun.net.www.protocol.http.HttpURLConnection incompatible with javax.net.ssl.HttpsURLConnection
May I know if there is anyway to solve it? I have to use HttpsURLConnection.
Thank you!
Hi,
you did not provide your import statements contained in the class. Please check which class named HttpsURLConnection you are trying to import.
Maybe your import refers to sun.net.www.protocol.http..., which is imcompatible with the one in javax.net.ssl....
Bye.
Similar Messages
-
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 -
ClassCastException while creating sendstream
Hi,
I'm trying to establish an unicast rtp session and play an url to the remote client.
DataSource[] sources = new DataSource[urls.length];
for(int i = 0; i < urls.length; i++) {
sources[i] = Manager.createDataSource(urls);
DataSource mergedDataSource = Manager.createMergingDataSource(sources);
SendStream sendStream = m_rtpManager.createSendStream(mergedDataSource, 1);
sendStream.start();
I throws ClassCastException while creating the sendstream object.
java.lang.ClassCastException
at com.sun.media.rtp.RTPSessionMgr.createSendStream(RTPSessionMgr.java:1098)
at com.sun.media.rtp.RTPSessionMgr.createSendStream(RTPSessionMgr.java:1262)
at com.untd.apps.ms.rtp.session.RtpSession.play(RtpSession.java:85)
at com.untd.apps.ms.action.HandleAnncCommand.execute(HandleAnncCommand.java:44)
I decompiled the RtpSessionMgr class and here are the few lines of the createSendStream method
/** RtpSessionMgr class **/
public SendStream createSendStream(int ssrc, javax.media.protocol.DataSource ds, int streamindex)
throws UnsupportedFormatException, IOException, SSRCInUseException
SSRCInfo i = cache.lookup(ssrc);
if(i != null)
throw new SSRCInUseException("SSRC supplied is already in use");
int newSSRC = ssrc;
if(cache.rtcp_bw_fraction == 0.0D)
throw new IOException("Initialized with zero RTP/RTCP outgoing bandwidth. Cannot create a sending stream ");
PushBufferStream streams[] = ((PushBufferDataSource)ds).getStreams();
PushBufferStream sendstream = streams[streamindex];
The datsource that I use is PullDataSource (In the api, it is mentioned that we can pass both push and pullDatasources to this method).
By default the Datasource for http protocol is an instance of PullDataSource. But in the createSendStream method, the dataSource is casted to PushDataSource. I guess this is why it throws ClassCastException.
Could someone please help me resolve this error.
Thanks,
Ganesh.Never mind. Resolved the issue myself.
By setting the audio formats using processor, I resolved the issue. The datasource from processor.getDataOutput() is a PushDataSource. -
ClassCastException while getting EJBRemote
Hi,
I am getting a ClassCastException while trying to get the EJBRemote (SessionRemote) of a stateless session bean in oc4j 10.1.2
Object lookupObject = CEJBContext.getHome(loc_s_lookupName);
Class lookupClass = lookupObject.getClass();
lookupObject = PortableRemoteObject.narrow(lookupObject, lookupClass);
Method method = lookupClass.getMethod("create", null);
SessionRemote remote = (SessionRemote)method.invoke(lookupObject, null);
Any help will be appreciated.The application is packaged into a EAR with a web module and the ejb module.
This error is coming while either casting the home or the remote ejb.
I am getting the system log related to the error
08/06/23 17:26:31 RequestHandler:1CCC01
08/06/23 17:26:31 RequestHandler:1RoutingProcessFacade
08/06/23 17:26:32 Error exporting object RoutingProcessFacade EJBHometo POA: Error initializing POAs : Unable to create POA
08/06/23 17:26:32 RequestHandler:1
08/06/23 17:26:32 RequestHandler:2
08/06/23 17:26:32 RequestHandler:3
08/06/23 17:26:32 lookupObject:RoutingProcessFacade EJBHome
08/06/23 17:26:32 RequestHandler:4
08/06/23 17:26:32 Error exporting object RoutingProcessFacade stateless sessionto POA: Error initializing POAs : Unable to create POA
08/06/23 17:26:32 __Proxy1
The stack trace is also attached
08/06/23 17:26:32 java.lang.ClassCastException
08/06/23 17:26:32 at com.ejb.util.RequestHandler.executeRequest(RequestHandler.java:45)
08/06/23 17:26:32 at com.ccc.action.HoldThread.run(HoldThread.java:43)
08/06/23 17:26:32 at java.lang.Thread.run(Thread.java:534)
08/06/23 17:26:32 java.lang.NullPointerException
08/06/23 17:26:32 at com.ccc.action.HoldThread.run(HoldThread.java:50)
08/06/23 17:26:32 at java.lang.Thread.run(Thread.java:534)
Can please anyone help. This is urgent.
Regards
Gautam -
ClassCastException while creating a new entity
Hi
When I run my BC4J application module using the BC4J Tester using Local Configuration (Jdev 9.0.3) I received the following exception when trying to create a new Customers record:
oracle.jbo.RowCreateException: JBO-25017: Error while creating a new entity row for Customers.
ewRowImpl.java:284
oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewObjectImpl.createInstance(oracle.jbo.server.ViewRowSetImpl, oracle.jbo.AttributeList)
ViewObjectImpl.java:1922
oracle.jbo.server.RowImpl oracle.jbo.server.QueryCollection.createRowWithEntities(int[], oracle.jbo.server.EntityImpl[], oracle.jbo.server.ViewRowSetImpl, oracle.jbo.AttributeList)
QueryCollection.java:727
oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(int[], oracle.jbo.server.EntityImpl[], oracle.jbo.AttributeList)
ViewRowSetImpl.java:1384
oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(oracle.jbo.AttributeList)
ViewRowSetImpl.java:1430
oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.createRow()
ViewRowSetImpl.java:1406
oracle.jbo.Row oracle.jbo.server.ViewObjectImpl.createRow()
ViewObjectImpl.java:5133
void oracle.dacf.dataset.RowsetAccessImpl.newRow()
RowsetAccessImpl.java:1013
void client.CustomerEditDlg2.reInitData(int, long, long)
CustomerEditDlg2.java:2017
void client.MainFrame.jMenuItem1_actionPerformed(java.awt.event.ActionEvent)
MainFrame.java:766
void client.MainFrame$17.actionPerformed(java.awt.event.ActionEvent)
MainFrame.java:283
void javax.swing.AbstractButton.fireActionPerformed(java.awt.event.ActionEvent)
AbstractButton.java:1450
void javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(java.awt.event.ActionEvent)
AbstractButton.java:1504
void javax.swing.DefaultButtonModel.fireActionPerformed(java.awt.event.ActionEvent)
DefaultButtonModel.java:378
void javax.swing.DefaultButtonModel.setPressed(boolean)
DefaultButtonModel.java:250
void javax.swing.AbstractButton.doClick(int)
AbstractButton.java:279
void javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(java.awt.event.MouseEvent)
BasicMenuItemUI.java:886
void java.awt.Component.processMouseEvent(java.awt.event.MouseEvent)
Component.java:3715
void java.awt.Component.processEvent(java.awt.AWTEvent)
Component.java:3544
void java.awt.Container.processEvent(java.awt.AWTEvent)
Container.java:1164
void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
Component.java:2593
void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
Container.java:1213
void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
Component.java:2497
void java.awt.LightweightDispatcher.retargetMouseEvent(java.awt.Component, int, java.awt.event.MouseEvent)
Container.java:2451
boolean java.awt.LightweightDispatcher.processMouseEvent(java.awt.event.MouseEvent)
Container.java:2216
boolean java.awt.LightweightDispatcher.dispatchEvent(java.awt.AWTEvent)
Container.java:2125
void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
Container.java:1200
void java.awt.Window.dispatchEventImpl(java.awt.AWTEvent)
Window.java:922
void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
Component.java:2497
void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
EventQueue.java:339
boolean java.awt.EventDispatchThread.pumpOneEventForHierarchy(java.awt.Component)
EventDispatchThread.java:131
void java.awt.EventDispatchThread.pumpEventsForHierarchy(java.awt.Conditional, java.awt.Component)
EventDispatchThread.java:98
void java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional)
EventDispatchThread.java:93
void java.awt.EventDispatchThread.run()
EventDispatchThread.java:85
## Detail 0 ##
java.lang.ClassCastException: oracle.jbo.server.EntityRowSetImpl
void oracle.jbo.server.EntityImpl.doCreate(oracle.jbo.AttributeList)
EntityImpl.java:399
void oracle.jbo.server.EntityImpl.create(oracle.jbo.AttributeList)
EntityImpl.java:337
void billing.CustomersImpl.create(oracle.jbo.AttributeList)
CustomersImpl.java:91
void oracle.jbo.server.ViewRowStorage.create(oracle.jbo.AttributeList)
ViewRowStorage.java:655
void oracle.jbo.server.ViewRowImpl.create(oracle.jbo.AttributeList)
ViewRowImpl.java:284
oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewObjectImpl.createInstance(oracle.jbo.server.ViewRowSetImpl, oracle.jbo.AttributeList)
ViewObjectImpl.java:1922
oracle.jbo.server.RowImpl oracle.jbo.server.QueryCollection.createRowWithEntities(int[], oracle.jbo.server.EntityImpl[], oracle.jbo.server.ViewRowSetImpl, oracle.jbo.AttributeList)
QueryCollection.java:727
oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(int[], oracle.jbo.server.EntityImpl[], oracle.jbo.AttributeList)
ViewRowSetImpl.java:1384
oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(oracle.jbo.AttributeList)
ViewRowSetImpl.java:1430
oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.createRow()
ViewRowSetImpl.java:1406
oracle.jbo.Row oracle.jbo.server.ViewObjectImpl.createRow()
ViewObjectImpl.java:5133
void oracle.dacf.dataset.RowsetAccessImpl.newRow()
RowsetAccessImpl.java:1013
void client.CustomerEditDlg2.reInitData(int, long, long)
CustomerEditDlg2.java:2017
void client.MainFrame.jMenuItem1_actionPerformed(java.awt.event.ActionEvent)
MainFrame.java:766
void client.MainFrame$17.actionPerformed(java.awt.event.ActionEvent)
MainFrame.java:283
void javax.swing.AbstractButton.fireActionPerformed(java.awt.event.ActionEvent)
AbstractButton.java:1450
void javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(java.awt.event.ActionEvent)
AbstractButton.java:1504
void javax.swing.DefaultButtonModel.fireActionPerformed(java.awt.event.ActionEvent)
DefaultButtonModel.java:378
void javax.swing.DefaultButtonModel.setPressed(boolean)
DefaultButtonModel.java:250
void javax.swing.AbstractButton.doClick(int)
AbstractButton.java:279
void javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(java.awt.event.MouseEvent)
BasicMenuItemUI.java:886
void java.awt.Component.processMouseEvent(java.awt.event.MouseEvent)
Component.java:3715
void java.awt.Component.processEvent(java.awt.AWTEvent)
Component.java:3544
void java.awt.Container.processEvent(java.awt.AWTEvent)
Container.java:1164
void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
Component.java:2593
void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
Container.java:1213
void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
Component.java:2497
void java.awt.LightweightDispatcher.retargetMouseEvent(java.awt.Component, int, java.awt.event.MouseEvent)
Container.java:2451
boolean java.awt.LightweightDispatcher.processMouseEvent(java.awt.event.MouseEvent)
Container.java:2216
boolean java.awt.LightweightDispatcher.dispatchEvent(java.awt.AWTEvent)
Container.java:2125
void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
Container.java:1200
void java.awt.Window.dispatchEventImpl(java.awt.AWTEvent)
Window.java:922
void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
Component.java:2497
void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
EventQueue.java:339
boolean java.awt.EventDispatchThread.pumpOneEventForHierarchy(java.awt.Component)
EventDispatchThread.java:131
void java.awt.EventDispatchThread.pumpEventsForHierarchy(java.awt.Conditional, java.awt.Component)
EventDispatchThread.java:98
void java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional)
EventDispatchThread.java:93
void java.awt.EventDispatchThread.run()
EventDispatchThread.java:85
I have seen this type of error earlier but this time exception is throws from the very core of the BC4J framework.( void oracle.jbo.server.EntityImpl.doCreate(oracle.jbo.AttributeList) ). "Customers" entity object does have a number of associated objects and I think that this is somehow related to the associations.
Can anyone help me with this? Thank youjava.lang.ClassCastException: oracle.jbo.server.EntityRowSetImpl
void oracle.jbo.server.EntityImpl.doCreate(oracle.jbo.AttributeList)
EntityImpl.java:399
I have seen this type of error earlier but this time exception is throws from the very core of the BC4J framework.( void oracle.jbo.server.EntityImpl.doCreate(oracle.jbo.AttributeList) ). "Customers" entity object does have a number of associated objects and I think that this is somehow related to the associations. You're right on the target. It seems like you have a composition association where the master side returns a RowIterator rather than a Row (meaning association cardinality for the master/source side for the composition association is 'many'). That should not be allowed. Infact this is a design time bug for the BC4J association wizard. I've logged it as bug number 2678717
Can anyone help me with this? Thank you -
Getting ClassCastException while calling a method in webservice
I wrote small webservice using axis. It is returning array of object(of xyz type) where an object is a Value object.
I created stubs and place at client side as a jar file. xyz.class is also there in stubs list.
While calling that webservice im getting the following exception.can u please help me on this?
The code is:
xyz[] so = lmsDel.getNumber();
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.ClassCastException: [Ljava.lang.Object;
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:evoke12
java.lang.ClassCastException: [Ljava.lang.Object;
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
ationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endEleme
nt(AbstractSAXParser.java:633)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scan
EndElement(XMLNSDocumentScannerImpl.java:719)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1242)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:133)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:153)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContext.parse(Deserialization
Context.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
tandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.cscinfo.webservice.client.LmsServiceSoapBindingStub.getSOPCountBy
NatureOfCase(Unknown Source)
at com.cscinfo.cscglobal.web.action.EnterCSCGlobalAction.execute(EnterCS
CGlobalAction.java:68)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:116
4)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
tyHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:283)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:42)
at com.cj.trim.trimFilter.doFilter(Unknown Source)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:42)
at weblogicx.servlet.gzip.filter.GZIPFilter.doFilter(GZIPFilter.java:70)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:3229)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
ervletContext.java:2002)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
ontext.java:1908)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
ava:1362)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Edited by: avn_venki on Jan 30, 2008 1:17 AMDelegate definition:
public xyz[] getCount(String accessType,long orgId,Date fromDate,Date toDate)
return lmsServiceImpl.getCount(accessType,orgId,fromDate,toDate);
Calling code in client:
xyz[] so = lmsDel.getCount("group",l,calendar,calendar);
Do i need to add anything to the wsdd file for the xyz bean type?? -
ClassCastException while inserting in oracle.sql.BLOB
Hi,
I have to insert a blob data in to database . I wrote the code . I'm having a ClassCastException problem in the line oracle.sql.BLOB blob = oracle.sql.BLOB.createTemporary(st.getConnection(), false,
oracle.sql.BLOB.DURATION_CALL); while trying to store a BLOB value I'm using Oracle 9i. (JDBC classes12.jar).
if I use the method with a dedicated database connection that specifies the driver as oracle.jdbc.driver.OracleDriver there is no problem .
But when I use JBoss to run , I will get ClassCastException
I imagine that somewhere in the code of this method there is a cast of the underlying connection leading to the ClassCastException when used in conjunction with the jboss datasource. The code to save the BLOB is as follows:
String sql = " update test set code = ? where id = ? ";
BLOB newBlob = BLOB.createTemporary(dbcon, false, BLOB.DURATION_CALL);
newBlob.putBytes(1,data.getBytes());
stmt = dbcon.prepareStatement(newsql);
stmt.setBlob(1, newBlob);
stmt.setInt(2, Studid );
stmt.executeUpdate();
stmt.close();Can any one tell me how can I get this code to work with the datasource implementation.
ThanksI think this could be a problem with the class loader . Take a look at this thread It should solve your problem.
http://forum.java.sun.com/thread.jspa?forumID=48&threadID=788715 -
IMP:ClassCastException while using File upload UI in Webdynpro for java
Hi All,
I have used a FileUpload UI element in my screen , which is working fine for only the first time we upload a file. If we try to upload any file with out refreshing the application , a ClassCastException is being thrown. Please help me in resolving the issue.
Thanks in advance.
SrikanthThank you!!
1. But when i use the File Upload UI and try to use the 'data' property to retrieve the bytes i am getting a null pointer exception meaning the data is not being picked up by the UI even though browsed file has data.
2. How I am I supposed to set the 'Resource' property while downloading a PDF which has UTF-16 text and picture??
Note: I have done the same scenario using WD04 java without any trouble.
reg
vln -
ClassCastException while using session bean in OC4J
I am facing the same problem while deploying a stateless session bean in Oracle 9i AS 1.0.2.2.1. The details are given below.
The following code snippet is used in the client to prepare for the lookup:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
//the following line can also have the actual machine name instead of "localhost"
env.put(Context.PROVIDER_URL, "ormi://localhost:23893/myejbs");
Context ctx = new InitialContext(env);
System.out.println("Getting Home....");
Object obj=ctx.lookup("Grouping");
System.out.println("Home Object Is : "+obj);
GroupingHome groupingHome = (GroupingHome)obj;
System.out.println("Got Home");
Grouping grouping = groupingHome.create( );
graphs=grouping.<mehtods>();
I've edited the config/server.xml file to have the following line:
<application name="myejbs" path="C:\oracle\ora102\j2ee\home\applications\classes\myejbs" auto-start="true" />
which points to the directory where the class files reside
I've also change the port in the config/rmi.xml file to 23893.
Now... the problem that I am facing is - while I am running a client from outside the server JVM i.e standalone client... which uses the Grouping interfaces, it works fine. giving me the desired result. But the moment I place the code in a service client deployed in the server or a jsp, I get a ClassCastException for GroupingHome whereas the SOP that I have given after lookup shows that I have found - "Grouping EJBHome". The funny thisng is that bith the working client and the JSP are using sme set of interface class files - Grouping.class (Remote) and GroupingHome.class.
Where am I going wrong?? If anybody knows, or Giri has found an answer to his query... please post a reply.
Thanks.
PS: I've tried new InitialContext(); solution but it didn't work. I have also narrowed the home object with javax.rmi.PortableRemoteObject.narrow(obj,GroupingHome.class) but to no avail :(.Hi Gauarv,
Did you not see my reply in the following post?
Re: 502 service temporarily unavailable
If I'm not mistaken, this is exactly the same question as you asked
there.
By the way, is there some reason you are still using OC4J version
1.0.2.2? Is there something stopping you from upgrading to the later
versions (9.0.2 and 9.0.3)?
Good Luck,
Avi. -
Classcast exception while using HttpsURLConnection
I am using java1.3. I have downloaded all the jars in JSSE..however when i am using the HttpsURLConnection class i get ClassCase exception at
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
I don't get any error while compiling however get the error when executing
Any help on this will greatly appricated.
Thanks
SudhaMagic, that worked for me.
Now the real question is why did it work. My code worked fine under JRE 1.3.1, but when I remove jsse.jar from my classpath and upgraded to JRE 1.4.1 it broke. By commenting out the System.setProperty it now works. Strange.
Cheers,
Paul -
ClassCastException - While type casting Home object after EJB JNDI Lookup
Sun One Application Server throws a ClassCastException when I try to type cast Home object to it's respective interface type.
Here is the code ---
==============================================
Object obj = PortableRemoteObject.narrow( context.lookup( jndiName ), homeClass);
System.out.println("Remote Object - obj : "+obj);
if (obj != null) {
System.out.println("obj.getClass().getName() : "+obj.getClass().getName());
System.out.println("obj.getClass().getSuperclass() : "+obj.getClass().getSuperclass());
Class[] interfaces = obj.getClass().getInterfaces();
if (interfaces != null) {
for (int count = 0; count < interfaces.length; count++) {
System.out.println("interfaces[ " + count + " ].getName() : " + interfaces[ count ].getName());
}==============================================
The class name is dislpayed as the Stub class name.
While displaying the interfaces, the Home Interface name is displayed.
But later when I try to type cast it into Home Interface type, it throws a ClassCastException.
Can somebody please check this?Please post the stack trace. Also, take a look at our EJB FAQ to make sure you're doing the
recommended lookup :
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html -
ClassCastException while trying to call P6 WS from ADF deploying CXF client
I have written a CXF client to access P6 WS and it works fine from the IDEs. But while I try to integrate with by writing a client program and including jar file from standalone app, it fails and is throwing the
Exception in thread "main" java.lang.ClassCastException: weblogic.wsee.jaxws.spi.ClientInstanceInvocationHandler cannot be cast to org.apache.cxf.frontend.ClientProxy
at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
at com.boa.bes.client.WSClient.Setup(WSClient.java:87)
at com.boa.bes.client.WSClient.main(WSClient.java:223)
Process exited with exit code 1.
The portal is developed on the Oracle ADF Framework.
Even though the org.apache.cxf jars are present in classpath, it is unable to do the casting and throwing the error. Does anyone who how to resolve this error? Can we override the default class loading that is not allowing the cast to happen? Any help is appreciated!
My code in main method is as below
URL wsdlURL = new URL("http://172.18.90.40:8206/p6ws/services/ProjectService?wsdl");
ProjectService service = new ProjectService(wsdlURL);
ProjectPortType servicePort = service.getProjectPort();
Client client = ClientProxy.getClient(servicePort);I have written a CXF client to access P6 WS and it works fine from the IDEs. But while I try to integrate with by writing a client program and including jar file from standalone app, it fails and is throwing the
Exception in thread "main" java.lang.ClassCastException: weblogic.wsee.jaxws.spi.ClientInstanceInvocationHandler cannot be cast to org.apache.cxf.frontend.ClientProxy
at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
at com.boa.bes.client.WSClient.Setup(WSClient.java:87)
at com.boa.bes.client.WSClient.main(WSClient.java:223)
Process exited with exit code 1.
The portal is developed on the Oracle ADF Framework.
Even though the org.apache.cxf jars are present in classpath, it is unable to do the casting and throwing the error. Does anyone who how to resolve this error? Can we override the default class loading that is not allowing the cast to happen? Any help is appreciated!
My code in main method is as below
URL wsdlURL = new URL("http://172.18.90.40:8206/p6ws/services/ProjectService?wsdl");
ProjectService service = new ProjectService(wsdlURL);
ProjectPortType servicePort = service.getProjectPort();
Client client = ClientProxy.getClient(servicePort); -
ClassCastException while populating DropDownByKey
I am getting the below exception while I am trying to populate the dropdown, everything I have written in the code seems to be correct. Unable to resolve
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.MatrixLayoutAdapter$Cells.getContent(MatrixLayoutAdapter.java:578)Hi,
Assume the structure is
node1
---att1
Let the cardinality of the node is 1:1 or 1:n
IWDNode n=wdContext.getChildNode("node1",0);
IWDNodeInfo nf=n.getNodeInfo();
IWDAttributeInfo attributeInfo =nf.getAttribute("att1");
//wdComponentAPI.getMessageManager().reportSuccess("AttributeInfo:"+attributeInfo);
ISimpleTypeModifiable countryType = attributeInfo.getModifiableSimpleType();
IModifiableSimpleValueSet valueSet = countryType.getSVServices().getModifiableSimpleValueSet();
for (int i = 0; i < 40; i++)
valueSet.put("ID"+i,"Customer"+i);
Regards,
Vijai -
ClassCastException while copying a resource
Hi All,
I have a customRespositorymanager, where I have implemented the method copyResource in my NamespaceManager. When I perform a copy operation
on a resource, I get a ClassCastException error.
The full stacktrace is given below.
But strangely enough,when I refresh the page,
the resource is actually copied to the
destination folder. Any idea why the UI
is throwing this ClassCastException?
<u><b>The version I am working on NW04 SPS09 Patch 3</b></u>java.lang.ClassCastException
at com.sapportals.wcm.repository.GeneralImpl2.internalCopyManager(GeneralImpl2.java:583)
at com.sapportals.wcm.repository.ResourceImpl2.internalCopyManager(ResourceImpl2.java:244)
at com.sapportals.wcm.repository.ResourceImpl.internalCopy(ResourceImpl.java:2152)
at com.sapportals.wcm.repository.ResourceImpl.copy(ResourceImpl.java:1415)
at com.sapportals.wcm.repository.ResourceImpl.copy(ResourceImpl.java:1398)
at com.sapportals.wcm.rfadapter.CopyUtility.copy(CopyUtility.java:112)
at com.sapportals.wcm.rendering.uicommand.cm.CopyUtil.singleNewCopy(CopyUtil.java:96)
at com.sapportals.wcm.rendering.uicommand.cm.CopyUtil.copy(CopyUtil.java:52)
at com.sapportals.wcm.rendering.uicommand.cm.UICopyCommand.execute(UICopyCommand.java:148)
at com.sapportals.wcm.rendering.uicommand.cm.UIMassEmbeddedSelectCommand.execute(UIMassEmbeddedSelectCommand.java:87)
at com.sapportals.wcm.rendering.uicommand.cm.UIMassEmbeddedSelectCommand.execute(UIMassEmbeddedSelectCommand.java:66)
at com.sapportals.wcm.rendering.control.cm.CommandDispatcher.onMassExecute(CommandDispatcher.java:45)
at com.sapportals.wcm.rendering.control.cm.WdfProxy.onMassExecute(WdfProxy.java:2209)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sapportals.wdf.stack.Control.dispatchHtmlbEvent(Control.java:386)
at com.sapportals.wdf.WdfEventDispatcher.dispatch(WdfEventDispatcher.java:175)
at com.sapportals.wdf.WdfCompositeController.onWdfEvent(WdfCompositeController.java:538)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sapportals.htmlb.page.DynPage.doProcessCompositeEvent(DynPage.java:204)
at com.sapportals.htmlb.page.DynPage.doProcessCurrentEvent(DynPage.java:142)
at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:115)
at com.sapportals.htmlb.page.PageProcessorServlet.handleRequest(PageProcessorServlet.java:62)
at com.sapportals.htmlb.page.PageProcessorServlet.doPost(PageProcessorServlet.java:22)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sapportals.wcm.app.servlet.WcmHtmlbBaseServlet.service(WcmHtmlbBaseServlet.java:100)
at com.sapportals.wcm.portal.proxy.PCProxyServlet.service(PCProxyServlet.java:313)
at com.sapportals.portal.prt.core.broker.ServletComponentItem$ServletWrapperComponent.doContent(ServletComponentItem.java:110)
at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:232)
at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
at java.security.AccessController.doPrivileged(Native Method)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)hi Seema,
This seems to be an issue in the standard coding. I think you should open an CSN/OSS for this..
hope it helps..
regards,
Vinoth -
ClassCastException while creating an XML document in servlet
HI,
I am trying to create an XML document in a servlet and I am getting ClassCastException at runtime when casting org.w3c.dom.document to org.apache.crimson.tree.XmlDocument . I am using Tomcat 4.1
The same code is working fine when executed in a stand alone java program
Can anyone please help me in trying to solve this problem. I require it urgently.
The following is my code:
import java.io.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.apache.crimson.tree.XmlDocument;
public class test{
public void createxml (String username) throws Exception
Document doc=null;
DocumentBuilderFactory dbf=null;
DocumentBuilder db=null;
Element root=null;
Element poline=null;
org.apache.crimson.tree.XmlDocument xmldoc=null;
FileOutputStream fos=null;
dbf = DocumentBuilderFactory.newInstance ();
db = dbf.newDocumentBuilder ();
doc = db.newDocument ();
root = doc.createElement ("album");
doc.appendChild (root);
poline= doc.createElement("album-name");
root.appendChild(poline);
//I am getting the ClassCastException in this statement
xmldoc = (XmlDocument) doc;
fos = new java.io.FileOutputStream("xyz.xml");
xmldoc.write(fos);
fos.close();
}I am not too much of an expert on this issue, but I did a search. Maybe this page can help or point you in the right direction.
http://www.jspwiki.org/Wiki.jsp?page=A2AClassCastException
I hope this helps.
Maybe you are looking for
-
Two internal tables - calculation
Hi all, i have two internal tables: 1. structure: line: workarea e.g. 1 2 3 2 3 6 2. structure: 3000 6000
-
Logic dont see AU`s after try instal Vanguard1.2
Hi! After i instal Vanguard1.2(not Universal Binary)Logic go crash at startup (Reading AudioUnit cache...) But now i have upgrade Logic (7.2 to 7.2.1) and now it work, BUT Logic cant see any AU plugins or instruments I launch AU Meneger and do Reset
-
Oracle 11gR2 for RHEL5.5 – 32Bit version
Hello, I am trying to install Oracle 11g R2 on RHEL5.5 – 32Bit version. But some one psoted that 11g r2 is not supported on RHEL5.5 – 32Bit version. I am tyring to find the correct posting on internet but not able to find till.. Any idea about it , c
-
Greetings, I am simply wondering what is the recommended download package and setup for Oracle DB in my situation. I am a developer writing an app for a business who (will be) using an Oracle-based ERP inventory management system. On my computer I wi
-
E75 messaging settings lost after backup with OVI ...
Every time after an automatic backup with OVI suite, E75 automatically changes the messaging memory (from memory card to phone memory). After that, of course, e-mail notifications in display also disappears. Please correct this error.