• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to load primefaces-2.0.0.jar on Weblogic Start Up.

 
Sudha Varadharajan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if this post should belong in "weblogic" or "JSF" but since this is a error specific to JSF, I am posting it here.
I am using Weblogic11g which comes built in with "JSF1.2". I am trying out the new JSF2.0 implementation from "Primefaces" and so I had included "primefaces-2.0.0.jar" and Mojarra's JSF2.0 JARS in my WEB-INF/lib.

In my "weblogic.xml" I have the following setting:
<wls:container-descriptor>
<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>

What I see is:
1.) On Server Startup I see an exception ( please see exception below) to the effect that weblogic is unable to load "primefaces-2.0.0.jar" .
2.) However when I try a .xhtml page which uses the new JSF2.0 tags and Primefaces2.0 tags, everything works fine.

Since I have the <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes> in weblogic.xml, I think the web classloader is able to load JSF2.0 and primefaces2.0 correctly at runtime but on server startup weblogic is using his "in-built" JSF1.2 to read "primefaces-2.0.0.jar"(which has JSF2.0 .xsds) and bombs out .

Is there any way to force weblogic to read "primefaces-2.0.0.jar" correctly on server start up?.

Mar 9, 2010 9:13:28 AM com.sun.faces.config.AnnotationScanner processClasspath
SEVERE: Unable to process annotations for url, zip:C:/ORACLE/middleware/user_projects/domains/wls11_admin/servers/AdminServer/tmp/_WL_user/poc/jje3vo/war/WEB-INF/lib/primefaces-2.0.0.jar!/META-INF/faces-config.xml. Reason: java.io.FileNotFoundException: zip:C:/ORACLE/middleware/user_projects/domains/wls11_admin/servers/AdminServer/tmp/_WL_user/poc/jje3vo/war/WEB-INF/lib/primefaces-2.0.0.jar
Mar 9, 2010 9:13:28 AM com.sun.faces.config.AnnotationScanner processClasspath
SEVERE:
java.io.FileNotFoundException: zip:C:/ORACLE/middleware/user_projects/domains/wls11_admin/servers/AdminServer/tmp/_WL_user/poc/jje3vo/war/WEB-INF/lib/primefaces-2.0.0.jar
at weblogic.utils.zip.ZipURLConnection.connect(Handler.java:78)
at weblogic.utils.zip.ZipURLConnection.getInputStream(Handler.java:53)
at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:195)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:50)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:78)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:71)
at com.sun.faces.config.AnnotationScanner.processClasspath(AnnotationScanner.java:290)
at com.sun.faces.config.AnnotationScanner.getAnnotatedClasses(AnnotationScanner.java:215)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:765)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:736)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:329)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1801)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3045)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1397)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:54)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
 
karan khosla
Greenhorn
Posts: 25
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think except for the option to upgrade to a new version or applying a patchset there is a workaround that i tried and it worked for me.

Problem
It occurs because weblogic 10 is shipped with Mojarra JSF 1.2 and the version that we want to make it work is Mojarra JSF 2.0.

Solution
It's a simple fix. In weblogic there is a file called commEnv.bat/sh. If you are running windows edit the bat file, else if you are running Linux/Mac edit the sh file.

Search for PRE_CLASSPATH or WEBLOGIC_CLASSPATH and add a complete path to the jsf-api.jar, jsf-impl.jar before weblogic.jar and if you are using Primefaces, just append it afterwords. Restart the server, deploy your application make sure that jsf-api.jar and jsf-impl.jar are there in the lib folder, but you are now free to remove the primefaces jar as it is already loaded by weblogic at server start-up otherwise you will see the same error still your application won't break.

Hope this Helps!
cheers!
Posted the same solution here: http://forums.oracle.com/forums/thread.jspa?threadID=1043858&start=30&tstart=0
 
Eric Bresie
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may be a moot point by now, but..

I resolved this by placing the jar files in the domains\lib folder (not the WEB-INF\lib).

I seem to recall reading this may not be the best approach, but it did work. If anyone has details on why this might not be the preferred way?
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, there are 2 issues with resurrecting this thread:

1. WebLogic has changed one 2 years. At least I hope. Oracle may have its faults, but buying and paralyzing products is the hallmark of a different well-known company.

2. Because this solution is WebLogic-specific, you'd be more relevant (and get better advice) in the WebLogic forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!