Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

JSF with Developer Workplace 7.0 SP14

Hello,

I'm trying to port an J2EE application initially developed on a Tomcat 5.5 with Java 1.4.2 and JSF 1.1 to a NWDI.

Locally I use a Developer Workplace 7.0 SP14.

When I deploy the *.ear File (with the included *.war-file) to my local Application Server alway gives me a ClassCastException:

+#1.5 #00059A3C7800007B00000041000019D400045676BCD02BA5#1220967880687#com.sap.engine.services.servlets_jsp.Deploy#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.Deploy#Guest#0##n/a##626173507e7511ddb52700059a3c7800#SAPEngine_Application_Thread[impl:3]_6##0#0#Error##Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Cannot load filter < extensionsFilter > The error is: java.lang.ClassCastException

at com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents.addFilter(WebComponents.java:225)

at com.sap.engine.services.servlets_jsp.server.container.ApplicationThreadInitializer.loadFilters(ApplicationThreadInitializer.java:292)

at com.sap.engine.services.servlets_jsp.server.container.ApplicationThreadInitializer.run(ApplicationThreadInitializer.java:107)

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:102)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)

#

#1.5 #00059A3C7800007B00000043000019D400045676BCD02CC1#1220967880687#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##626173507e7511ddb52700059a3c7800#SAPEngine_Application_Thread[impl:3]_6##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Cannot load filter < extensionsFilter >

The error is: java.lang.ClassCastException: null

Exception id: [00059A3C7800007B00000041000019D400045676BCD02BA5]#

My Web.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<display-name>WEB APP</display-name>

<description>WEB APP description</description>

<servlet>

<servlet-name>Faces Servlet</servlet-name>

<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>*.jsf</url-pattern>

</servlet-mapping>

<filter>

<filter-name>extensionsFilter</filter-name>

<filter-class>

org.apache.myfaces.webapp.filter.ExtensionsFilter

</filter-class>

<init-param>

<param-name>maxFileSize</param-name>

<param-value>20m</param-value>

</init-param>

</filter>

....

The Method "addFilter" in the class "sap.engine.services.servlets_jsp.server.runtime.context.WebComponents" which is part of the "servlet_jsp.jar" (also Used DC of my Web Component) looks as this:

public Vector addFilter(String filterName, String filterClassName, HashMapObjectObject params)

{

Class clasFilter = null;

Filter filter = null;

Vector warnings = new Vector();

filterClasses.put(filterName, filterClassName);

filterParams.put(filterName, params);

try

{

clasFilter = applicationClassLoader.loadClass(filterClassName);

filter = (Filter)clasFilter.newInstance();

}

catch(OutOfMemoryError e)

{

throw e;

}

catch(ThreadDeath e)

{

throw e;

}

catch(Throwable e)

{

Log.getCategory(1).logError(currentLocation, "Cannot load filter < " + filterName + " >", e, aliasName);

warnings.add(new LocalizableTextFormatter(WebResourceAccessor.getResourceAccessor(), WebWarningException.CANNOT_LOAD_FILTER, new Object[] {

filterName, e.toString()

}));

return warnings;

}

....

As one can see, both sides implement the interface "javax.servlet.Filter", which is part of the library "servlet.jar".

To veryfy this I "enhanced" the method "addFilter" by some additional output which gives me the classes and interfaces:

public Vector addFilter(String filterName, String filterClassName, HashMapObjectObject params)

{

Class clasFilter = null;

Filter filter = null;

Vector warnings = new Vector();

filterClasses.put(filterName, filterClassName);

filterParams.put(filterName, params);

try

{

Log.getCategory(1).logError(currentLocation, "Meinlog 1 < " + filterClassName + " >", null, aliasName);

clasFilter = applicationClassLoader.loadClass(filterClassName);

Log.getCategory(1).logError(currentLocation, "Meinlog 2 < " + clasFilter.toString() + " >", null, aliasName);

//Log.getCategory(1).logError(currentLocation, "Meinlog 2b < " + clasFilter.getDeclaringClass().getClass().getName() + " >", null, aliasName);

Log.getCategory(1).logError(currentLocation, "Meinlog 3 < " + Filter.class.toString() + " >", null, aliasName);

Object obj = clasFilter.newInstance();

String ausgabe = obj!=null?obj.toString():"null";

String ausgabe2;

try {

ausgabe2 = obj!=null?obj.getClass().getInterfaces()[0].toString():"null";

} catch (Exception ex){

ausgabe2=ex.getMessage();

}

Log.getCategory(1).logError(currentLocation, "Meinlog 4 < " + ausgabe + " >", null, aliasName);

Log.getCategory(1).logError(currentLocation, "Meinlog 5 < " + ausgabe2 + " >", null, aliasName);

filter = (Filter)obj;

Log.getCategory(1).logError(currentLocation, "Meinlog 6 < " + filter.toString() + " >", null, aliasName);

}

...

This generated the following log:

#1.5 #00059A3C7800006B000000830000169C000456876CE37E25#1221039554156#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 1 < com.sap.engine.services.servlets_jsp.server.servlet.PutProtectionFilter >#

#1.5 #00059A3C7800006B000000850000169C000456876CE3E05E#1221039554187#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 2 < class com.sap.engine.services.servlets_jsp.server.servlet.PutProtectionFilter >#

#1.5 #00059A3C7800006B000000870000169C000456876CE3E11E#1221039554187#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 3 < interface javax.servlet.Filter >#

#1.5 #00059A3C7800006B000000890000169C000456876CE3E1F1#1221039554187#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 4 < com.sap.engine.services.servlets_jsp.server.servlet.PutProtectionFilter@180a84e >#

#1.5 #00059A3C7800006B0000008B0000169C000456876CE3E2A5#1221039554187#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 5 < interface javax.servlet.Filter >#

#1.5 #00059A3C7800006B0000008D0000169C000456876CE3E35C#1221039554187#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 6 < com.sap.engine.services.servlets_jsp.server.servlet.PutProtectionFilter@180a84e >#

#1.5 #00059A3C7800006B0000008F0000169C000456876CE42ACE#1221039554203#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 1 < com.sap.engine.services.servlets_jsp.server.servlet.ConnectionWrapperFilter >#

#1.5 #00059A3C7800006B000000910000169C000456876CE42D37#1221039554203#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 2 < class com.sap.engine.services.servlets_jsp.server.servlet.ConnectionWrapperFilter >#

#1.5 #00059A3C7800006B000000930000169C000456876CE42DF8#1221039554203#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 3 < interface javax.servlet.Filter >#

#1.5 #00059A3C7800006B000000950000169C000456876CE42EBA#1221039554203#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 4 < com.sap.engine.services.servlets_jsp.server.servlet.ConnectionWrapperFilter@e47ec1 >#

#1.5 #00059A3C7800006B000000970000169C000456876CE42F73#1221039554203#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 5 < interface javax.servlet.Filter >#

#1.5 #00059A3C7800006B000000990000169C000456876CE43033#1221039554203#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 6 < com.sap.engine.services.servlets_jsp.server.servlet.ConnectionWrapperFilter@e47ec1 >#

#1.5 #00059A3C7800006B0000009B0000169C000456876CE430F6#1221039554203#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 1 < org.apache.myfaces.webapp.filter.ExtensionsFilter >#

#1.5 #00059A3C7800006B0000009D0000169C000456876CE43438#1221039554203#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 2 < class org.apache.myfaces.webapp.filter.ExtensionsFilter >#

#1.5 #00059A3C7800006B0000009F0000169C000456876CE434EF#1221039554203#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 3 < interface javax.servlet.Filter >#

#1.5 #00059A3C7800006B000000A10000169C000456876CF915AF#1221039555578#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 4 < org.apache.myfaces.webapp.filter.ExtensionsFilter@1295527 >#

#1.5 #00059A3C7800006B000000A30000169C000456876CF91664#1221039555578#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Meinlog 5 < interface javax.servlet.Filter >#

#1.5 #00059A3C7800006B000000A40000169C000456876CF91859#1221039555578#com.sap.engine.services.servlets_jsp.Deploy#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.Deploy#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error##Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Cannot load filter < extensionsFilter > The error is: java.lang.ClassCastException

at com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents.addFilter(WebComponents.java:225)

at com.sap.engine.services.servlets_jsp.server.container.ApplicationThreadInitializer.loadFilters(ApplicationThreadInitializer.java:292)

at com.sap.engine.services.servlets_jsp.server.container.ApplicationThreadInitializer.run(ApplicationThreadInitializer.java:107)

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:102)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)

#

#1.5 #00059A3C7800006B000000A60000169C000456876CF91937#1221039555578#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#bauerfeind.com/careplatformcareweb#com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents#Guest#0##n/a##713fd9707f1a11dda51300059a3c7800#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Plain###application [ECR_CAREPF_Dcareplatformcareservlet~bauerfeind.com] Cannot load filter < extensionsFilter >

The error is: java.lang.ClassCastException: null

Exception id: [00059A3C7800006B000000A40000169C000456876CF91859]#

As shown in "Meinlog 3" and "Meinlog 5" both sides implement the same Interface. So classcast should work.

I have no more idea about this. Does anybody of you have?

Best regards,

Jens Stolpmann

Edited by: Jens Stolpmann on Sep 10, 2008 12:03 PM

Former Member
replied

Either add a reference from the library:bauerfeind.comcareplatformmyfaces~lib (which I suppose loads the org.apache.myfaces.webapp.filter.ExtensionsFilter) to the library:servlet, or move its resources to the application WEB-INF\lib and remove the reference from the application to this library.

HTH!

\-- Vladimir

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question