This discussion is archived
7 Replies Latest reply: Mar 13, 2012 12:49 PM by 800089 RSS

Why does plain vanilla servlet require JSF library?

800089 Newbie
Currently Being Moderated
I have a simple servlet that does HTTP request/response stuff, no JSF or Hibernate or Spring or database. I'm building in Netbeans.

WEB-INF/lib contains:
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
httpclient-4.1.2.jar
httpcore-4.1.4.jar
javaee-web-api-6.0.jar
jsf-api.jar
jsf-impl.jar

If I don't include JSF 1.2 in the build profile, the app does build, but Weblogic 10.3.4 complains about missing JSF during deployment.
Is there a way to remove the faces dependency or is it just baked into the J2EE stuff these days? It's been a while since I've done servlet programming, but I seem to recall that it didn't used to be this way back in the olden days.

More critically, although my app does deploy and run (if I include JSF 1.2) on a development Weblogic 10.3.4 installation, it's not deploying to our service provider's Weblogic server. They say, please provide JSF in your web-inf/lib. Well, I am. How can they be running Weblogic without JSF in the path?

This seems like a tangle of dependencies for such a simple little app--any advice on what I'm undoubtedly doing wrong here? Thanks,

bp
  • 1. Re: Why does plain vanilla servlet require JSF library?
    user696 Explorer
    Currently Being Moderated
    Hi,

    Do you have any shared library references either in weblogic.xml or weblogic-application.xml which includes the jsf library?
    If you have one you should remove it so that it will not complain on deployment.

    HTH
    Sunil Polineni
  • 2. Re: Why does plain vanilla servlet require JSF library?
    800089 Newbie
    Currently Being Moderated
    Hi Sunil,

    No, no references to jsf that I know of. Here's my weblogic.xml:


    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
    <jsp-descriptor>
    <keepgenerated>true</keepgenerated>
    <debug>true</debug>
    </jsp-descriptor>
    <context-root>/MyServlet</context-root>
    <fast-swap>
    <enabled>true</enabled>
    </fast-swap>
    </weblogic-web-app>


    And here's my web.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <servlet>
    <servlet-name>MyServlet</servlet-name>
    <servlet-class>com.mycompany.myservlet.MyServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>MyServlet</servlet-name>
    <url-pattern>/MyServlet</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    </web-app>
  • 3. Re: Why does plain vanilla servlet require JSF library?
    user696 Explorer
    Currently Being Moderated
    what is the exception your getting? Can you paste complete exception stacktrace

    Regards,
    Sunil Polineni
  • 4. Re: Why does plain vanilla servlet require JSF library?
    david.karr Pro
    Currently Being Moderated
    How about you be specific about the exact error messages you're getting?
  • 5. Re: Why does plain vanilla servlet require JSF library?
    800089 Newbie
    Currently Being Moderated
    If I don't include JSF 1.2 in my netbeans build profile, Weblogic emits the following traceback upon deploy:

    User defined listener com.sun.faces.config.ConfigureListener failed: java.lang.ExceptionInInitializerError. java.lang.ExceptionInInitializerError at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:439) at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:482) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.EventsManager.notifyContextDestroyedEvent(EventsManager.java:200) at weblogic.servlet.internal.WebAppServletContext.destroy(WebAppServletContext.java:3224) at weblogic.servlet.internal.ServletContextManager.destroyContext(ServletContextManager.java:240) at weblogic.servlet.internal.HttpServer.unloadWebApp(HttpServer.java:461) at weblogic.servlet.internal.WebAppModule.destroyContexts(WebAppModule.java:1535) at weblogic.servlet.internal.WebAppModule.deactivate(WebAppModule.java:507) at weblogic.application.internal.flow.ModuleStateDriver$2.previous(ModuleStateDriver.java:387) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215) at weblogic.application.internal.flow.ModuleStateDriver.deactivate(ModuleStateDriver.java:141) at weblogic.application.internal.flow.ScopedModuleDriver.deactivate(ScopedModuleDriver.java:206) at weblogic.application.internal.flow.ModuleListenerInvoker.deactivate(ModuleListenerInvoker.java:261) at weblogic.application.internal.flow.DeploymentCallbackFlow$2.previous(DeploymentCallbackFlow.java:547) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215) at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:192) at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:184) at weblogic.application.internal.BaseDeployment$2.previous(BaseDeployment.java:642) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215) at weblogic.application.internal.BaseDeployment.deactivate(BaseDeployment.java:227) at weblogic.application.internal.SingleModuleDeployment.deactivate(SingleModuleDeployment.java:43) at weblogic.application.internal.DeploymentStateChecker.deactivate(DeploymentStateChecker.java:198) at weblogic.deploy.internal.targetserver.AppContainerInvoker.deactivate(AppContainerInvoker.java:98) at weblogic.deploy.internal.targetserver.operations.DeactivateOperation.deactivate(DeactivateOperation.java:78) at weblogic.deploy.internal.targetserver.operations.RemoveOperation.removeDeployment(RemoveOperation.java:306) at weblogic.deploy.internal.targetserver.operations.RemoveOperation.doCommit(RemoveOperation.java:114) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844) at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253) at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207) at weblogic.work.ExecuteThread.run(ExecuteThread.java:176) Caused By: java.lang.NullPointerException at javax.faces.context.FacesContext.<clinit>(FacesContext.java) at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:439) at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:482) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.EventsManager.notifyContextDestroyedEvent(EventsManager.java:200) at weblogic.servlet.internal.WebAppServletContext.destroy(WebAppServletContext.java:3224) at weblogic.servlet.internal.ServletContextManager.destroyContext(ServletContextManager.java:240) at weblogic.servlet.internal.HttpServer.unloadWebApp(HttpServer.java:461) at weblogic.servlet.internal.WebAppModule.destroyContexts(WebAppModule.java:1535) at weblogic.servlet.internal.WebAppModule.deactivate(WebAppModule.java:507) at weblogic.application.internal.flow.ModuleStateDriver$2.previous(ModuleStateDriver.java:387) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215) at weblogic.application.internal.flow.ModuleStateDriver.deactivate(ModuleStateDriver.java:141) at weblogic.application.internal.flow.ScopedModuleDriver.deactivate(ScopedModuleDriver.java:206) at weblogic.application.internal.flow.ModuleListenerInvoker.deactivate(ModuleListenerInvoker.java:261) at weblogic.application.internal.flow.DeploymentCallbackFlow$2.previous(DeploymentCallbackFlow.java:547) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215) at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:192) at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:184) at weblogic.application.internal.BaseDeployment$2.previous(BaseDeployment.java:642) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223) at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215) at weblogic.application.internal.BaseDeployment.deactivate(BaseDeployment.java:227) at weblogic.application.internal.SingleModuleDeployment.deactivate(SingleModuleDeployment.java:43) at weblogic.application.internal.DeploymentStateChecker.deactivate(DeploymentStateChecker.java:198) at weblogic.deploy.internal.targetserver.AppContainerInvoker.deactivate(AppContainerInvoker.java:98) at weblogic.deploy.internal.targetserver.operations.DeactivateOperation.deactivate(DeactivateOperation.java:78) at weblogic.deploy.internal.targetserver.operations.RemoveOperation.removeDeployment(RemoveOperation.java:306) at weblogic.deploy.internal.targetserver.operations.RemoveOperation.doCommit(RemoveOperation.java:114) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844) at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253) at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207) at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)


    The console displays this message:

    An error occurred during activation of changes, please see the log for details.
    weblogic.application.ModuleException:
    com.sun.faces.config.ConfigureListener

    added err msg
  • 6. Re: Why does plain vanilla servlet require JSF library?
    user696 Explorer
    Currently Being Moderated
    Are you deploying it as war file or ear file?
    If it ear file do you have any other war files which might have reference to JSF because from the exception it is trying Initialize JSF Listener, from the snippet weblogic.xml adn web.xml I do not see any reference of JSF.

    can you try to export war file and deploy it.

    Regards,
    Sunil Polineni
  • 7. Re: Why does plain vanilla servlet require JSF library?
    800089 Newbie
    Currently Being Moderated
    Hi Sunil - I was able to remove both J2EE and JSF from the build requirements, and now the app no longer requires jsf on WLS. Thanks for your help,
    bp

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points