Java.lang.ClassCastException caught for JMXServiceURL
Hi,
I have a jonas server running
I checked that the carol.jrmp.url=rmi://localhost:1181 in carol.properties file
I try to establish connection with this server using the following codes
try {
JMXServiceURL url =new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1181");
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
} catch (Exception e) {
System.err.println("Exception caught:" + e);
but it returns an java.lang.ClassCastException.
How do I resolve this?
Thanks
hi
Sorry...
The stacktrace shown to me is as follows:
java.lang.ClassCastException
at javax.management.remote.rmi.RMIConnector.narrowJRMPServer(RMIConnector.java:1796)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1791)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1751)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:259)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:247)
at connection.jonas.Client.main(Client.java:47)
Exception in thread "main"
Similar Messages
-
Hi,
Iam struggling with this problem from last 3days.
Any body could u help me to solve this problem.
error:
Caught an unexpected exception!
java.lang.ClassCastException at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow (PortableRemoteObject.java:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at ConverterClient.main(ConverterClient.java:59)
Client Code is here:
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.util.Properties;
import javax.ejb.CreateException;
import java.util.Hashtable;
// NOT NECESSARY import Converter;
// NOT NECESSARY import ConverterHome;
public class ConverterClient {
public static void main(String[] args) {
try {
Properties env = new Properties();
env.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
env.put("java.naming.provider.url", "iiop://localhost:3700");
Context initial = new InitialContext(env);
ConverterHome home =(ConverterHome)PortableRemoteObject.narrow(initial.lookup("MyConverter"),ConverterHome.class);
// Create converter session bean
Converter currencyConverter = home.create();
// Calculate from dollars to yen
double amount = currencyConverter.dollarToYen(100.00);
System.out.println("100 Dollars is " + String.valueOf(amount) + " Yen");
// Calculate from yen to dollars
amount = currencyConverter.yenToEuro(100.00);
System.out.println("100 Yen is " + String.valueOf(amount) + " Dollars");
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();Hi,
I have a stateless bean and accessing it from a jsp page in Orion App Server. There is no problem in the deployment. of the application.
When I access the bean from the jsp page is throwing
java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unknown Source)
The code is :
Object homeObject = null;
homeObject = ctx.lookup("LoginHome");
out.println(homeObject.toString());
LoginHome ejbHome = (LoginHome)PortableRemoteObject.narrow(homeObject,LoginHome.class);
Login login = ejbHome.create();
when I use the statement
homeOject.toString() to print the object it prints
LoginHome EJBHome
I am not able to resolve this for th epast three days.
Thanks,
Vivek S -
Solution needed for java.lang.ClassCastException
My code+_
public class EmployeeResultsCO extends OAControllerImpl
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
* Layout and page setup logic for a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (TransactionUnitHelper.isTransactionUnitInProgress(pageContext,"empCreateTxn", false))
am.invokeMethod("rollbackEmployee");
TransactionUnitHelper.endTransactionUnit(pageContext, "empCreateTxn");
// This controller is associated with the table.
OATableBean table = (OATableBean)webBean;
table.prepareForRendering(pageContext);
DataObjectList columnFormats = (DataObjectList)table.getColumnFormats();
DictionaryData columnFormat = null;
int childIndex = pageContext.findChildIndex(table, "DeleteSwitcher");
columnFormat =(DictionaryData)columnFormats.getItem(childIndex);
columnFormat.put(COLUMN_DATA_FORMAT_KEY, ICON_BUTTON_FORMAT);
// Implement the bound value for the Status Image
OAImageBean statusImageBean =
(OAImageBean)table.findIndexedChildRecursive("EmpStatus");
if (statusImageBean == null)
MessageToken[] tokens = { new MessageToken("OBJECT_NAME",
"EmpStatus") };
throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", tokens);
// Define the OA Framework image directory
FixedBoundValue imageDirectory =
new FixedBoundValue(APPS_MEDIA_DIRECTORY);
// Define a binding between the image bean and the view object attribute
// that it will reference to get the appropriate .gif image value name.
// Note that the corresponding attribute values are obtained using a
// decode() in the EmployeeSummaryVO view object.
OADataBoundValueViewObject statusBinding = new OADataBoundValueViewObject
(statusImageBean, "EmployeeStatus");
// Concatenate the image directory with the actual image name (as retrieved
// from the view object attribute decode() statement)
ConcatBoundValue statusCBV = new ConcatBoundValue(new BoundValue[]
{imageDirectory, statusBinding});
// Tell the image bean where to get the image source attribute
statusImageBean.setAttributeValue(SOURCE_ATTR, statusCBV);
// For accessibility compliance, you always specify the alternate text for an
// image. Note that you should never use static text as shown (always source
// translatable text from Message Dictionary when setting display text values
// programmatically), and ideally, the alternate text should in this case
// should clearly indicate the status the image represents.
// Generally, we would recommend that you use a Switcher as shown for the
// Delete column to easily show different images with associated alternate
// text, but we wanted to show how to use a bound value also in this lab.
statusImageBean.setAttributeValue(SHORT_DESC_ATTR, "Employee status indicator");
Error
oracle.apps.fnd.framework.OAException: java.lang.ClassCastException
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:597)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1133)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:937)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:904)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:937)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:904)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2318)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1717)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
at OA.jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
at OA.jspService(OA.jsp:45)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
java.lang.ClassCastException
at kumarkris.oracle.apps.ak.employee.webui.EmployeeResultsCO.processRequest(EmployeeResultsCO.java:59)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:581)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1133)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:937)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:904)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:937)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:904)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2318)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1717)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
at OA.jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
at OA.jspService(OA.jsp:45)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
java.lang.ClassCastException
at kumarkris.oracle.apps.ak.employee.webui.EmployeeResultsCO.processRequest(EmployeeResultsCO.java:59)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:581)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1133)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:937)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:904)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:937)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:904)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2318)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1717)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
at OA.jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
at OA.jspService(OA.jsp:45)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)## Detail 0 ##
java.lang.ClassCastException
at kumarkris.oracle.apps.ak.employee.webui.EmployeeResultsCO.processRequest(EmployeeResultsCO.java:59)What is the code at line no. 59 ?
-Anand -
Getting java.lang.ClassCastException after a few hours :(
Hi all,
i've deployed an application in oracle application server 10g
after a few hours running smooth i start to get the following error:
2010-02-09 02:06:28: oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.ClassCastException, msg=null
at acor_criaAlteracao._jspService(_acor__criaAlteracao.java:433)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
java.lang.ClassCastException
at acor_criaAlteracao._jspService(_acor__criaAlteracao.java:396)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
If i restart the oc4j container then the application runs smooth again ... if i wait a couple of hours i get the same error again.
any ideia ?
My environment
Oracle application server 10g (9.0.4) on windows 2003 enterprise server
Best Regards
Rui MadalenoQuestion is which part of the heap is running out of space. It is more likely that your PermGen space is too small. PermGen is used for static variable, static and literal String values and classes as well. You can increase it with -XX:MaxPermSize=<value>. With a max heap size of 1024m a good starting value is 128m.
Unfortunately, you're running a very old Oracle AS and a very old JDK. Newer Oracle AS or Oracle Fusion Middleware can use newer JDKs, OFM 11g (WLS 11g) loves to run JDK 1.6 and with visualvm and the visualgc plugin you can see all the private parts of the JVM.
--olaf -
Java.lang.ClassCastException
My class CDRack is almost ready, but in the last method
sortAlphabetically() there
comes java.lang.ClassCastException. I found in the net
http://java.sun.com/docs/books/tutorial/collections/algorithms/
that with method Collections.sort(l) I can sort alphabetically.
The code compiles, but when I run it with a tester program, it stops
to ClassCastException in the almost last row.
Something is wrong with Collections.sort(l) ?
/** Class CDRack represents collections of compact discs. Discs are
located in the rack in slots numbered from zero upwards. The discs are
represented by Record objects and empty slots by null values. */
public class CDRack extends Object {
private Record[] mRecords;
private int size;
/**Creates a new, empty CD rack.
Parameters:
size - the size of the new rack, i.e. the number of slots it has */
public CDRack(int size) {
mRecords = new Record[size];
this.size = size;
/** "Organizes" the discs in the rack so that they will be located in
consecutive slots starting at slot number zero, and any and all empty
slots will be at the "end of the rack". After calling this method, the
discs are in an undefined (i.e. arbitrary) order - the only thing this
method guarantees is that there aren't any empty slots in between full
ones.
public void organize() {
// Turn array into a list - more flexible
List l = Arrays.asList(aanilevyt);
// Remove all nulls from a copy of the list which supports removal.
l = new ArrayList(l);
while (l.remove(null)) /*do nothing*/;
// Clear the original array.
for (int i = 0; i < mRecords.length; i++){
mRecords[i] = null;
} // Put the non-nulls back.
l.toArray(mRecords);
/**"Organizes" the discs in the rack to the beginning of the rack (see
the method organize) and sorts them in alphabetical order. Recordings
by the same artist are placed in alphabetical order by disc name. */
public void sortAlphabetically() {
// Turn array into a list - more flexible
List l = Arrays.asList(aanilevyt);
// Remove all nulls from a copy of the list which supports removal.
l = new ArrayList(l);
while (l.remove(null)) /*do nothing*/;
// Clear the original array.
for (int i = 0; i < mRecords.length; i++){
mRecords[i] = null;
} // Put the non-nulls back.
l.toArray(mRecords);
Collections.sort(l); // alphabetical order. THERE IS CLASSCASTEXCEPTION
}I have thought and thought but the sorting alphabetically doesnt work.
I can't use Collections.sort and class Record doesnt implement Comparable(and I can't change it).
One suggestion was that I could make my own class which implements Comparator. Could it be like this
import java.util.*;
public class AlphabeticComparator
implements Comparator{
public int compare(Object o1, Object o2) {
String s1 = (String)o1;
String s2 = (String)o2;
return s1.toLowerCase().compareTo(
s2.toLowerCase());
} But how an earth can I tell to CDRack class that it would
use the class AlphabeticComparator?
Somebody please save my Christmas!
/** Class CDRack represents collections of compact discs. Discs are
located in the rack in slots numbered from zero upwards. The discs are
represented by Record objects and empty slots by null values. */
public class CDRack extends Object {
private Record[] mRecords;
private int size;
/**Creates a new, empty CD rack.
Parameters:
size - the size of the new rack, i.e. the number of slots it has */
public CDRack(int size) {
mRecords = new Record[size];
this.size = size;
/** "Organizes" the discs in the rack so that they will be located in
consecutive slots starting at slot number zero, and any and all empty
slots will be at the "end of the rack". After calling this method, the
discs are in an undefined (i.e. arbitrary) order - the only thing this
method guarantees is that there aren't any empty slots in between full
ones.
public void organize() {
// Turn array into a list - more flexible
List l = Arrays.asList(aanilevyt);
// Remove all nulls from a copy of the list which supports removal.
l = new ArrayList(l);
while (l.remove(null)) /*do nothing*/;
// Clear the original array.
for (int i = 0; i < mRecords.length; i++){
mRecords<i> = null;
} // Put the non-nulls back.
l.toArray(mRecords);
/**"Organizes" the discs in the rack to the beginning of the rack (see
the method organize) and sorts them in alphabetical order. Recordings
by the same artist are placed in alphabetical order by disc name. */
public void sortAlphabetically() { -
Hi All,
I am getting below exception when I am trying to establish HTTPS connection using
Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection
sometime my code works and some time it gives me this exception
below is the exception which i traced in a log file
2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0URL CONNECTION CALLED https://netfundstest.com/fsu/router
2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0URL CONNECTION Created HTTPClient.HttpURLConnection[https://netfundstest.com/fsu/router]
2008/09/11 01:07:57->1_1210001776_0:entered into else Block
2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0Error URLC Not a instance of HTTPS Connection: HTTPClient.HttpURLConnection[https://netfundstest.com/fsu/router]
2008/09/11 01:07:57->1_1210001776_0:Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection
In the success case when my HTTPS connection gets established I am getting following in the log file.
2008/08/24 11:51:28->1_1210001776_0:1_1210001776_0URL CONNECTION CALLED https://netfunds.com/fsu/router
2008/08/24 11:51:28->1_1210001776_0:1_1210001776_0URL CONNECTION Created com.sun.net.ssl.internal.www.protocol.https.DelegateHttpsURLConnection:https://netfunds.com/fsu/router
Here is the code which I am using
I am importing following packages in my code
import java.security.*;
import java.security.cert.*;
//import javax.net.ssl.*;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.HandshakeCompletedListener;
import javax.net.ssl.HandshakeCompletedEvent;
import javax.net.ssl.SSLSession;
import java.net.*;
import java.util.*;
import java.io.*;
//import javax.security.cert.*;
import com.sun.net.ssl.*;
//import org.apache.xalan.*;
//import org.apache.xerces.*;
import org.apache.xerces.dom.*;
import org.apache.xml.serialize.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import oracle.xml.classgen.*;
try
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
System.setProperty("https.proxyHost",geProxy);
System.setProperty("https.proxyPort",geProxyPort);
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
int n=0;
while(n<3)
debugMsg(instCount+"URL CONNECTION CALLED " + fsuFrontEndURL);
url = new URL(fsuFrontEndURL);
/* Changed to include Tunnel code */
urlc = url.openConnection();
debugMsg(instCount+"URL CONNECTION Created " + urlc);
if (urlc instanceof com.sun.net.ssl.HttpsURLConnection)
debugMsg("entered into If Block");
debugMsg("Value of n:" + n);
((com.sun.net.ssl.HttpsURLConnection) urlc).setSSLSocketFactory(new SSLTunnelSocketFactory(geProxy, geProxyPort));
((com.sun.net.ssl.HttpsURLConnection) urlc).setRequestMethod("POST");
debugMsg("after If Block");
break;
else {
try{
debugMsg("entered into else Block");
((javax.net.ssl.HttpsURLConnection) urlc).setSSLSocketFactory(new SSLTunnelSocketFactory(geProxy, geProxyPort));
((javax.net.ssl.HttpsURLConnection) urlc).setRequestMethod("POST");
debugMsg("after else Block");
break;
catch(Exception e) {
debugMsg(instCount+"Error URLC Not a instance of HTTPS Connection: " + urlc);
debugMsg("Exception: " + e);
I am using JDK 1.5 and Apache/1.3.19
Can anyone help me out ....?for URL'S Starting with HTTPS only.....Sometimes it works and sometimes it gives me the classcast exception
As soon as I bounces my Apache application server...then it starts working...I dont know why its happening like that..
Is there any issue with the Ports I am trying to connect or some Apache configuration files settings are getting changed ? -
Getting java.lang.ClassCastException
Hi All,
I am getting below exception when I am trying to establish HTTPS connection using
Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection
sometime my code works and some time it gives me this exception
below is the exception which i traced in a log file
2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0URL CONNECTION CALLED https://netfundstest.com/fsu/router
2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0URL CONNECTION Created HTTPClient.HttpURLConnection[https://netfundstest.com/fsu/router]
2008/09/11 01:07:57->1_1210001776_0:entered into else Block
2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0Error URLC Not a instance of HTTPS Connection: HTTPClient.HttpURLConnection[https://netfundstest.com/fsu/router]
2008/09/11 01:07:57->1_1210001776_0:Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection
In the success case when my HTTPS connection gets established I am getting following in the log file.
2008/08/24 11:51:28->1_1210001776_0:1_1210001776_0URL CONNECTION CALLED https://netfunds.com/fsu/router
2008/08/24 11:51:28->1_1210001776_0:1_1210001776_0URL CONNECTION Created com.sun.net.ssl.internal.www.protocol.https.DelegateHttpsURLConnection:https://netfunds.com/fsu/router
Here is the code which I am using
I am importing following packages in my code
import java.security.*;
import java.security.cert.*;
//import javax.net.ssl.*;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.HandshakeCompletedListener;
import javax.net.ssl.HandshakeCompletedEvent;
import javax.net.ssl.SSLSession;
import java.net.*;
import java.util.*;
import java.io.*;
//import javax.security.cert.*;
import com.sun.net.ssl.*;
//import org.apache.xalan.*;
//import org.apache.xerces.*;
import org.apache.xerces.dom.*;
import org.apache.xml.serialize.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import oracle.xml.classgen.*;
try
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
System.setProperty("https.proxyHost",geProxy);
System.setProperty("https.proxyPort",geProxyPort);
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
int n=0;
while(n<3)
debugMsg(instCount+"URL CONNECTION CALLED " + fsuFrontEndURL);
url = new URL(fsuFrontEndURL);
/* Changed to include Tunnel code */
urlc = url.openConnection();
debugMsg(instCount+"URL CONNECTION Created " + urlc);
if (urlc instanceof com.sun.net.ssl.HttpsURLConnection)
debugMsg("entered into If Block");
debugMsg("Value of n:" + n);
((com.sun.net.ssl.HttpsURLConnection) urlc).setSSLSocketFactory(new SSLTunnelSocketFactory(geProxy, geProxyPort));
((com.sun.net.ssl.HttpsURLConnection) urlc).setRequestMethod("POST");
debugMsg("after If Block");
break;
else {
try{
debugMsg("entered into else Block");
((javax.net.ssl.HttpsURLConnection) urlc).setSSLSocketFactory(new SSLTunnelSocketFactory(geProxy, geProxyPort));
((javax.net.ssl.HttpsURLConnection) urlc).setRequestMethod("POST");
debugMsg("after else Block");
break;
catch(Exception e) {
debugMsg(instCount+"Error URLC Not a instance of HTTPS Connection: " + urlc);
debugMsg("Exception: " + e);
I am using JDK 1.5 and Apache/1.3.19
Can anyone help me out ....?Hi ejp,
thanks for ur response
I did what ever u suggested ...but after compiling the code I am getting following errors
cannot find symbol
symbol : class X509TrustManager
location: class EPCardXMLExchange
class MyX509TrustManager implements X509TrustManager {
^
EPCardXMLExchange.java:594: cannot find symbol
symbol : class HostnameVerifier
location: class EPCardXMLExchange
class MyHostnameVerifier implements HostnameVerifier {
^
EPCardXMLExchange.java:413: cannot find symbol
symbol : class X509TrustManager
location: class EPCardXMLExchange
X509TrustManager tm = new MyX509TrustManager();
^
EPCardXMLExchange.java:414: cannot find symbol
symbol : class HostnameVerifier
location: class EPCardXMLExchange
HostnameVerifier hm = new MyHostnameVerifier();
^
EPCardXMLExchange.java:429: cannot find symbol
symbol : class KeyManagerFactory
location: class EPCardXMLExchange
KeyManagerFactory kmf;
^
EPCardXMLExchange.java:430: cannot find symbol
symbol : variable KeyManagerFactory
location: class EPCardXMLExchange
kmf = KeyManagerFactory.getInstance("SunX509");
^
EPCardXMLExchange.java:440: cannot find symbol
symbol : class TrustManager
location: class EPCardXMLExchange
TrustManager []tma = {tm};
^
EPCardXMLExchange.java:441: cannot find symbol
symbol : class SSLContext
location: class EPCardXMLExchange
SSLContext sc = SSLContext.getInstance("SSL");
^
EPCardXMLExchange.java:441: cannot find symbol
symbol : variable SSLContext
location: class EPCardXMLExchange
SSLContext sc = SSLContext.getInstance("SSL");
^
EPCardXMLExchange.java:444: cannot find symbol
symbol : variable HttpsURLConnection
location: class EPCardXMLExchange
HttpsURLConnection.setDefaultSSLSocketFactory(sf1);
^
EPCardXMLExchange.java:445: cannot find symbol
symbol : variable HttpsURLConnection
location: class EPCardXMLExchange
HttpsURLConnection.setDefaultHostnameVerifier(hm);
^
EPCardXMLExchange.java:643: cannot find symbol
symbol : class X509TrustManager
location: class EPCardXMLExchange.SSLTunnelSocketFactory
X509TrustManager tm = new MyX509TrustManager();
^
EPCardXMLExchange.java:644: cannot find symbol
symbol : class HostnameVerifier
location: class EPCardXMLExchange.SSLTunnelSocketFactory
HostnameVerifier hm = new MyHostnameVerifier();
^
EPCardXMLExchange.java:658: cannot find symbol
symbol : class KeyManagerFactory
location: class EPCardXMLExchange.SSLTunnelSocketFactory
KeyManagerFactory kmf;
^
EPCardXMLExchange.java:659: cannot find symbol
symbol : variable KeyManagerFactory
location: class EPCardXMLExchange.SSLTunnelSocketFactory
kmf = KeyManagerFactory.getInstance("SunX509");
^
EPCardXMLExchange.java:669: cannot find symbol
symbol : class TrustManager
location: class EPCardXMLExchange.SSLTunnelSocketFactory
TrustManager []tma = {tm};
^
EPCardXMLExchange.java:670: cannot find symbol
symbol : class SSLContext
location: class EPCardXMLExchange.SSLTunnelSocketFactory
SSLContext sc = SSLContext.getInstance("SSL");
^
EPCardXMLExchange.java:670: cannot find symbol
symbol : variable SSLContext
location: class EPCardXMLExchange.SSLTunnelSocketFactory
SSLContext sc = SSLContext.getInstance("SSL");
^
EPCardXMLExchange.java:675: cannot find symbol
symbol : variable HttpsURLConnection
location: class EPCardXMLExchange.SSLTunnelSocketFactory
HttpsURLConnection.setDefaultSSLSocketFactory(dfactory);
^
EPCardXMLExchange.java:676: cannot find symbol
symbol : variable HttpsURLConnection
location: class EPCardXMLExchange.SSLTunnelSocketFactory
HttpsURLConnection.setDefaultHostnameVerifier(hm);
^
20 errors
Can you tell me what I am getting errors ? -
Java.lang.ClassCastException on SelectionListener of ADF table
HI ,
I am getting the following error when using the default SelectionListener in a af:table (#{bindings.address.collectionModel.makeCurrent})
javax.el.ELException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.List
ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #1This happens when I click on a row of the table.
Doing this programatically also causes the same issue.
LOG:
<Error> <oracle.adfinternal.view.faces.config.rich.RegistrationConfigurator> <BEA-000000> <ADF_FACES-60096:Server Exception during PPR, #1
javax.el.ELException: javax.el.ELException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.List
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1300)
at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:268)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:144)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:402)
at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:148)
at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:271)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:144)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:402)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:879)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:312)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:185)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.bpel.services.workflow.client.worklist.util.WorkflowFilter.doFilter(WorkflowFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.bpel.services.workflow.client.worklist.util.DisableUrlSessionFilter.doFilter(DisableUrlSessionFilter.java:70)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused By: javax.el.ELException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.List
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at org.ieee.internal.util.AdfUtils.invokeEL(AdfUtils.java:112)
at org.ieee.internal.backing.fragments.EditValidationDetails.getSelectedAddress(EditValidationDetails.java:1550)
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:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1300)
at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:268)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:144)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:402)
at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:148)
at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:271)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:144)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:402)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:879)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:312)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:185)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.bpel.services.workflow.client.worklist.util.WorkflowFilter.doFilter(WorkflowFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.bpel.services.workflow.client.worklist.util.DisableUrlSessionFilter.doFilter(DisableUrlSessionFilter.java:70)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused By: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.List
at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.setRowKey(FacesCtrlHierBinding.java:633)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.makeCurrent(FacesCtrlHierBinding.java:482)
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:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at org.ieee.internal.util.AdfUtils.invokeEL(AdfUtils.java:112)
at org.ieee.internal.backing.fragments.EditValidationDetails.getSelectedAddress(EditValidationDetails.java:1550)
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:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1300)
at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:268)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:144)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:402)
at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:148)
at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:271)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:144)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:402)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:879)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:312)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:185)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.bpel.services.workflow.client.worklist.util.WorkflowFilter.doFilter(WorkflowFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.bpel.services.workflow.client.worklist.util.DisableUrlSessionFilter.doFilter(DisableUrlSessionFilter.java:70)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
>Thanks
Thoom
Edited by: User007 on Sep 7, 2011 10:02 AM
Edited by: User007 on Sep 7, 2011 10:08 AMHey found the issue..
Actually i am trying to reset value of table from Bean. By default there is a value attached to table from bindings and setting another value from bean which was a POJO object.
On selection of row the casting issue raising up.
Issue is gone after removing that.
Thanks...
Edited by: User007 on Sep 7, 2011 10:41 AM -
Java.lang.ClassCastException in JSP page
My JSP page:
<%@page contentType="text/html"%>
<HTML>
<HEAD>
<TITLE> JDBC Servlet/JSP Example </TITLE>
</HEAD>
<BODY>
<%@ page import="myBeans.memoryBean" %>
<%@ page import="java.util.Vector" %>
<H1> JDBC Servlet/JSP Example </H1>
<H2> <%= session.getValue("message") %>
</H2>
<UL>
<%
Vector vData = (Vector) session.getValue("res");
myBeans.memoryBean mb;
Object o;
for (Enumeration e = vData.elements() ; e.hasMoreElements() ;) {
o = e.nextElement();
mb = (myBeans.memoryBean) o;
%>
<LI> <%= o.getClass().getName() %>
<% } // end for
%>
</UL>
</BODY>
</HTML>Notice that I don't even use the object I cast but I still get the error message:
Exception:
java.lang.ClassCastException
at _memory._search._jspService(_search.java:66)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java)
at oracle.jsp.JspServlet.internalService(JspServlet.java)
at oracle.jsp.JspServlet.service(JspServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
at org.apache.jserv.JServConnection.run(JServConnection.java:188)
at java.lang.Thread.run(Thread.java:534)When I comment out the line that castes my object my browser displays:
JDBC Servlet/JSP Example
Records Found:
* myBeans.memoryBean
* myBeans.memoryBean
* myBeans.memoryBean Notice that the three objects that are returned are exactly the type that I caste to.
Also, I did a getClass().getClassLoader() when I create the objects in my servlet code and again on the JSP pages for each object I pull out of the vector and the class loader matched.
I even changed the package on my bean class and recompiled everything to make sure it wasn't a old .class file floating around.
Could this have something to do with my classpath or where my classes are being placed? I found a similar problem here: http://forum.java.sun.com/thread.jsp?forum=33&thread=380437&start=0&range=15&hilite=false&q=
but the explanation of what was done wasn't clear
Anyone have any idea what's going on here?
I am using:
Oracle 9i
Oracle HTTP Server Powered by Apache/1.3.12 (Unix)
ApacheJServ/1.1
Thanks in advance.
- LinusIs ti at all possible that you have another jar / zip file with the same class file in it, seemingly away from the Server classpath ? In which case this could happen even though logically it shouldn't !!!
-
Java.lang.ClassCastException in simple struts application. please help me!
I have a simple struts application, it only have a login form. however, it's alway throw java.lang.ClassCastException when I submit the form. Here is full stack trace:
14-03-2007 17:04:50 org.apache.struts.chain.ComposableRequestProcessor init
INFO: Initializing composable request processor for module prefix ''
14-03-2007 17:04:50 org.apache.struts.chain.commands.servlet.CreateAction getAction
INFO: Initialize action of type: ndlinh.struts.lab.RegistrationForm
14-03-2007 17:04:50 org.apache.struts.chain.commands.AbstractExceptionHandler execute
WARNING: Unhandled exception
java.lang.ClassCastException: ndlinh.struts.lab.RegistrationForm
at org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:66)
at org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:82)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
14-03-2007 17:04:50 org.apache.struts.chain.commands.ExceptionCatcher postprocess
WARNING: Exception from exceptionCommand 'servlet-exception'
java.lang.ClassCastException: ndlinh.struts.lab.RegistrationForm
at org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:66)
at org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:82)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Here is my code:
package ndlinh.struts.lab;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
public class RegistrationForm extends ActionForm {
private String userid = null;
private String password = null;
private String password2 = null;
public RegistrationForm() {
System.out.println("************ Registration Form created *************");
* @return the password
public String getPassword() {
return password;
* @param password the password to set
public void setPassword(String password) {
this.password = password;
* @return the password2
public String getPassword2() {
return password2;
* @param password2 the password2 to set
public void setPassword2(String password2) {
this.password2 = password2;
* @return the userid
public String getUserid() {
return userid;
* @param userid the userid to set
public void setUserid(String userid) {
this.userid = userid;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
userid = "";
password = "";
password2 = "";
package ndlinh.struts.lab;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public final class RegistrationAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse response)
try {
System.out.println("*******************" + actionForm.toString() + "*******************");
RegistrationForm form = (RegistrationForm)actionForm;
String username = form.getUserid();
String password = form.getPassword();
System.out.println(username);
// simple login checking.
// if userid equals password, user can login to system
if ( username.equalsIgnoreCase(password)) {
return mapping.findForward("success");
} else {
return mapping.findForward("failure");
} catch (Exception e) {
e.printStackTrace();
return mapping.findForward("failure");
}registration.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<html:form action="/register">
Username: <html:text property="userid" /> <br />
Password: <html:password property="password" /> <br />
Re-type: <html:password property="password2" />
<html:submit value="Register" />
</html:form>
</body>
</html>struts-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="registrationForm" type="ndlinh.struts.lab.RegistrationForm" />
</form-beans>
<action-mappings>
<action path="/register"
type="ndlinh.struts.lab.RegistrationForm"
name="registrationForm"
validate="false"
scope="request"
input="registration.jsp" >
<forward name="success" path="/jsp/success.jsp" />
<forward name="failure" path="/jsp/failure.jsp" />
</action>
</action-mappings>
</struts-config>web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>System information:
Tomcat 5.5.20
Struts 1.3.5
JDK1.5.08struts-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="registrationForm" type="ndlinh.struts.lab.RegistrationForm" />
</form-beans>
<action-mappings>
<action path="/register"
type="ndlinh.struts.lab.RegistrationAction" // action class
name="registrationForm" // form bean name
validate="false"
scope="request"
input="registration.jsp" >
<forward name="success" path="/jsp/success.jsp" />
<forward name="failure" path="/jsp/failure.jsp" />
</action>
</action-mappings>
</struts-config>HTH -
Hi ,
I'm creating a dbadapter for a custom API written in APPS schema -
TYPE MISIPM_LOB IS RECORD (
FILE_ID IPM_LOBS.FILE_ID%TYPE,
FILE_NAME IPM_LOBS.LOB_NAME%TYPE );
TYPE MISIPM_LOB_LIST IS TABLE OF MISIPM_LOB;
PROCEDURE GET_FILE_ID_DETAILS(
P_SOURCE_SYSTEM IN VARCHAR2,
p_entity_value IN VARCHAR2,
p_entity_code IN VARCHAR2,
P_ORG_ID IN NUMBER,
P_MISIPM_FILES_LIST OUT MISIPM_LOB_LIST,
P_ERRCODE OUT VARCHAR2,
P_ERRMESSAGE OUT VARCHAR2);
From JDeveloper, there is a wrapper package is getting created and the compilation/deployment of this composite is also without any error.
But when I run the composite, I'm surprisingly getting the below error -
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'GetAttachmentMetaData' failed due to: Interaction processing error. Error while processing the execution of the APPS.BPEL_GETATTACHMENTMETADATA1.XX_DELIVER_BLOB$GET_FILE_ API interaction. An error occurred while processing the interaction for invoking the APPS.BPEL_GETATTACHMENTMETADATA1.XX_DELIVER_BLOB$GET_FILE_ API. Cause: java.lang.ClassCastException: oracle.sql.StructDescriptor Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD. This exception is considered not retriable, likely due to a modelling mistake. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
I recreated the adapter multiple times within the composite and also tried to create a separate composite and all the cases the error message received was same. There two more similar procedure call's in the composite and all rest of them are working fine.
I can call the wrapper from sql script separately.
Verified that the XSD generated and the wrapper package parameters are matching as well.
Did anyone face the same issue or any explanation/help is much appreciated.
Regards,
DebanjanHi Vijay,
I have checked the number of parameters as well.
<element name="InputParameters">
<complexType>
<sequence>
<element name="P_SOURCE_SYSTEM" type="string" db:index="1" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
<element name="P_ENTITY_VALUE" type="string" db:index="2" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
<element name="P_ENTITY_CODE" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
<element name="P_ORG_ID" type="decimal" db:index="4" db:type="NUMBER" minOccurs="0" nillable="true"/>
</sequence>
</complexType>
</element>
<element name="OutputParameters">
<complexType>
<sequence>
<element name="P_MISIPM_FILES_LIST" type="db:APPS.XX_DELIVER_X35784324X1X5" db:index="5" db:type="Array" minOccurs="0" nillable="true"/>
<element name="P_ERRCODE" type="string" db:index="6" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
<element name="P_ERRMESSAGE" type="string" db:index="7" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
</sequence>
</complexType>
</element>
<complexType name="APPS.XX_DELIVER_X35784324X1X6">
<sequence>
<element name="FILE_ID" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
<element name="FILE_NAME" db:type="VARCHAR2" minOccurs="0" nillable="true">
<simpleType>
<restriction base="string">
<maxLength value="2000"/>
</restriction>
</simpleType>
</element>
</sequence>
</complexType>
<complexType name="APPS.XX_DELIVER_X35784324X1X5">
<sequence>
<element name="P_MISIPM_FILES_LIST_ITEM" type="db:APPS.XX_DELIVER_X35784324X1X6" db:type="Struct" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
</sequence>
</complexType>
Regards,
Debanjan -
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 -
I encountered a bug while using the deploytool to deploy
an EAR file to the Sun J2EE 1.3_01 server.
I submitted a bug report to Sun via the Sun Java Developer Connection.
(Sorry, it has not been assigned a BugID yet)
Question:
Does anybody know if the web container in Sun's
J2EE 1.3_01 server supports access to local enterprise beans?
Screenshots of the bug are available at
http://sync4j.sourceforge.net/deploymentbug/
Full details below....
-Sean
category: j2ee
subcategory: deployment
release: 1.3_01
hardware: x86
OSversion: windows_2000
synopsis: java.lang.ClassCastException thrown during deployment of Session bean
java -version
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
C:\j2sdkee1.3\bin>j2ee -version
Java 2 Enterprise Edition version 1.3_01, build 1.3_01-b01
I built a EJB 2.0 compliant stateful session bean.
The session bean has a remote interface (ISyncRemote),
a remote home interface (ISyncHomeRemote),
a local interface (ISyncLocal),
and a local home interface (ISyncHomeLocal).
I built an HTTP Servlet that is supposed to access
the Stateful Session Bean using ISyncHomeLocal and
ISyncLocal
I run "deploytool.bat" in GUI mode to perform the deployment.
During deployment, the deploytool GUI displays a message
box which states:
"There was a deployment error.
java.rmi.ServerException: RemoteException occurred in server thread;
nested exception is:
java.rmi.RemoteException: An error was encountered while loading
a web component.
Please refer to
<J2EE_HOME>/logs/<machine-name>/j2ee//j2ee/error.log
for more information. Please verify your Application with the
Verifier tool."
The "error.log" file did not contain any useful information.
I ran the J2EE "verifier.bat" tool to verify that my EAR archive is OK.
The Sun J2EE server output this error string:
"java.lang.ClassCastException:
com.sun.enterprise.deployment.EjbExternalDescriptor"
Here is the full output from the Sun J2EE server:
C:\j2sdkee1.3\bin>j2ee -verbose
J2EE server listen port: 1050
Naming service started:1050
Binding DataSource, name = jdbc/EstoreDB, url =
jdbc:cloudscape:rmi:CloudscapeDB;create=true
Binding DataSource, name = jdbc/Cloudscape, url =
jdbc:cloudscape:rmi:CloudscapeDB;create=true
Binding DataSource, name = jdbc/DB1, url =
jdbc:cloudscape:rmi:CloudscapeDB;create=true
Binding DataSource, name = jdbc/DB2, url =
jdbc:cloudscape:rmi:CloudscapeDB;create=true
Binding DataSource, name = jdbc/InventoryDB, url =
jdbc:cloudscape:rmi:CloudscapeDB;create=true
Binding DataSource, name = jdbc/XACloudscape, url = jdbc/XACloudscape__xa
Binding DataSource, name = jdbc/XACloudscape__xa, dataSource =
COM.cloudscape.core.RemoteXaDataSourc
e@245536
Starting JMS service...
Initialization complete - waiting for client requests
Binding: < JMS Destination : jms/Queue , javax.jms.Queue >
Binding: < JMS Destination : jms/Topic , javax.jms.Topic >
Binding: < JMS Cnx Factory : TopicConnectionFactory , Topic , No properties >
Binding: < JMS Cnx Factory : jms/TopicConnectionFactory , Topic , No properties
>
Binding: < JMS Cnx Factory : QueueConnectionFactory , Queue , No properties >
Binding: < JMS Cnx Factory : jms/QueueConnectionFactory , Queue , No properties
>
Starting web service at port: 8000
Starting secure web service at port: 7000
J2EE SDK/1.3
Starting web service at port: 9191
J2EE SDK/1.3
J2EE server startup complete.
Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
application\sync4j\server\s
yncbean\SyncBean_LocalHomeImpl.java ....
Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
application\sync4j\server\s
yncbean\SyncBean_EJBLocalObjectImpl.java ....
Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
application\sync4j\server\s
yncbean\SyncBean_RemoteHomeImpl.java ....
Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
application\sync4j\server\s
yncbean\SyncBean_EJBObjectImpl.java ....
rmic sync4j.server.syncbean.SyncBean_RemoteHomeImpl...
rmic sync4j.server.syncbean.SyncBean_EJBObjectImpl...
c:\j2sdkee1.3\repository\rbi\applications\Sync4j Server enterprise
application1004172068449Server.ja
r
Binding name:`java:comp/env/ejb/ISyncHomeRemote`
Binding name:`java:comp/env/ejb/ISyncHomeLocal`
java.lang.ClassCastException:
com.sun.enterprise.deployment.EjbExternalDescriptor
at com.sun.enterprise.deployment.EjbReferenceDescriptor.getValue
(EjbReferenceDescriptor.java
:202)
at com.sun.enterprise.naming.NamingManagerImpl.bindObjects
(NamingManagerImpl.java:394)
at com.sun.web.server.WebService.addContext(WebService.java:148)
at com.sun.web.server.ServletDeployerImpl.loadWebComponents
(ServletDeployerImpl.java:214)
at
com.sun.enterprise.tools.deployment.backend.JarInstallerImpl.deployWebComponent
s
(JarInsta
llerImpl.java:791)
at
com.sun.enterprise.tools.deployment.backend.JarInstallerImpl.deployApplication
(JarInstall
erImpl.java:219)
at
org.omg.stub.com.sun.enterprise.tools.deployment.backend._JarInstallerImpl_Tie.
invoke(Un
known Source)
at com.sun.corba.ee.internal.corba.ServerDelegate.dispatch
(ServerDelegate.java:355)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:273)
at com.sun.corba.ee.internal.iiop.RequestProcessor.process
(RequestProcessor.java:84)
at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run
(ThreadPool.java:99)
Does the Sun J2EE server implementation support the invocation
of Session EJB's via a Local interface?
Does the Sun J2EE server implementation allow a Servlet to invoke
Session EJB's via the bean's Local interface?
While researching this issue, I read the J2EE 1.3 final specification.
The spec says:
"The EJB container is required to access to local enterprise beans.
We recommend that the web container also support access to local
enterprise beans."
Does the web container in Sun's J2EE server support access to local enterprise beans?I'm pretty much sure that you cannot access a
local Session bean from outside the EJB container.Please read the J2EE 1.3 specification before posting messages about EJB and J2EE.
According to the J2EE 1.3 specification:
"The EJB container is required to support access to local enterprise beans. We recommend that the web container also support access to local enterprise beans.
No support is provided for access to local enterprise beans from the application client container or the applet container."
If you use local interfaces for your session bean,
than your client must be local too. A local client is
a client that is collocated in the same JVM with the
session/entity that provides the local view and which
can be tightly coupled to the bean.My client is running in the same JVM as my EJB. The client is a servlet. The servlet is running in the same JVM as the EJB.
For what its worth, the error that I observed occurs during deployment. I haven't figured out why deployment is failing. -
Bom Dia
Nesta solução NF-e do B2B Outbound Attachment +Body eu tive um problema ao testar o Module Gui gerei o pacote .ear fiz o deploy do mesmo no J2ee e
acontece um erro quando testo o envio do e-mail
Message processing failed. Cause: java.lang.ClassCastException: class com.sap.sdn.nfe.SetAttachmentNameLocalHomeImpl0_0 can not be casted to ModuleLocalHome or SModuleLocalHome
1 - já tirei os .jar de referencia do ".ear"(Extrai usando o WinZip) mais não funcionou...
.jar extraido do .EAR antes do deploy..!
aii_af_cci.jar
aii_af_ms_api.jar
aii_af_trace.jar
aii_af_cpa.jar
aii_af_ms_spi.jar
aii_af_mp.jar
aii_af_svc.jar
Alguém teria alguma dica doque poderia estar ocorrendo..?
Agradeço desde já
RONALDO DE MORAESRoberti ...,
Eliminando as classes geradas e ajustando para as classes standard...!!
Existiam alguns erros.....com.sap.sdn.nfe.SetAttachmentNameLocalhome quando na verdade deveria ser isso com.sap.aii.af.mp.module.ModuleLocalHome
esse erro só notei quando olhei a doc postada pelo Roberti ...
http://wiki.sdn.sap.com/wiki/pages/editpage.action?pageId=233474286
Obrigado ...pela força Robert e Henrique -
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
Maybe you are looking for
-
How to add two nodes in a Hierarchy
Hi Experts, I have 0ACCOUNT hierarchy using for P&L report. I developed this hierarchy to get the values of Revenue and Expenses (nodes). Once I get this values I want the difference of this two to get the Income Statement. I have Re
-
Sales Order wise contribution report
Hi Guru's, I am using transaction code KVBI to get sales order wise contribution reports for make to order materials. Similarly, i want to have such report for male to stock strategy materials.... so can i get it? Regards, Abhishek
-
How to add jQuery to master page
Hi, I'm using designer to add jQuery to master page. But i get this error below. Please help me to understand this and solve this. Many thanks for your response in advance.
-
I'm developing a WEB service for Sun ONE deployment (AppServer7). I'm developing on Windows XP Pro though will deploy on Solaris, Sun AppServer7 includes a XercesImpl.jar in share/lib. 2 kb different than the one I usually use (xerces-2_1_0). If I co
-
HI is there any report for Service tax, how much i ve paid to vendor, how much i have collected from customer...............how much difference i have to pay goverment. 2. i want to see opening , debit, credit, closing balance of service tax. Regard