views:

15

answers:

1

I'm trying to deploy a very simple Struts app on WebLogic 11gR1. The app has one JSP called Welcome.jsp and this JSP contains the following tag :

<bean:cookie name="" id=""/>

The associated taglib is imported at the top of the JSP using the following line :

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>

When this tag is inside the JSP, I've the following error :

Welcome.jsp:11:24: javax.servlet.http.Cookie cannot be resolved
<body bgcolor="white"><bean:cookie name="" id=""/>

But when I remove this tag, the Welcome.jsp works just fine.

The JSP includes other tags like :

<bean:message key="welcome.heading"/>

Those tags are working just fine.

And to finish, the ActionServlet of Struts is also working and starting with the app.

I'm guessing that there must be a classloading problem but I don't understand why the Struts ActionServlet is working : javax.servlet.http.Cookie and javax.servlet.http.HttpServlet are declared in the same package.

Maybe, there is a problem with the Oracle implementation of the Cookie class in WebLogic but it is very unlikely.

Thanks.

A: 

javax.servlet.http.Cookie is an interface showing the structure that those who are implementing the Servlet API need to implement.

The issue might be with your WebLogic 11gR1 configuration/libary: I'll explain using Tomcat 7.0.

In Tomcat 7.0, under TOMCAT_HOME/lib folder, there's a servlet-api.jar. That jar allows Tomcat to support the Java Servlet API specification (and has Cookie.class included in the directory, under javax/servlet/Cookie).

Your WebLogic 11gR1 must have a Servlet Container library that conforms to the Servlet API (like Tomcat's servlet-api.jar). I never used WebLogic, but if you have a lib folder somewhere (apparently WL_HOME/server/lib), make sure there's a servlet api somewhere (I think weblogic.jar contains servlet api implementations).

Also, please check that you don't have a servlet like library (e.g. servlet-api.jar, eclipse servlet jars, etc.) inside your WAR file as it can conflict with WebLogic's servlet library.

The Elite Gentleman
I've checked that I don't have a servlet library inside my WAR (Maven scope : provided). As I said in the question, WebLogic provide a servlet librairy with javax.servlet.http.Cookie and javax.servlet.http.HttpServlet, but it doesn't work as expected.
lepnio