cancel
Showing results for 
Search instead for 
Did you mean: 

Previewing Seam based Web projects

achatterjee
Champ in-the-making
Champ in-the-making
Hi,

My requirement is to maintain a JBOSS Seam based web project inside Alfresco WCM. However when I'm trying to preview the website using the user sandbox preview, I'm getting an error saying that the Seam servlet class cannot be loaded. However when I deploy the same site onto JBOSS manually, my website is functioning properly. I have all the required Seam libraries in the lib folder within WEB-INF. Can any one please point me what am I missing here. The following is the website structure:

/
|_ pages
|  |_index.xhtml
|_WEB-INF
|   |_lib
|  |   |_seam jars
|  |_components.xml
|  |_faces-config.xml
|  |_jboss-web.xml
|  |_pages.xml
|  |_web.xml
|_META-INF
3 REPLIES 3

mtaal
Champ in-the-making
Champ in-the-making
I have the same requirement and also the same exception.

To add some information. The catalina.out of the virtualization server shows this stacktrace also:
java.lang.RuntimeException: Error handling file /media/alfresco/cifs/v/test3–admin/VERSION/v-1/DATA/www/avm_webapps/ROOT/WEB-INF/classes
   at org.jboss.seam.deployment.URLScanner.handleArchiveByFile(URLScanner.java:128)
   at org.jboss.seam.deployment.URLScanner.handle(URLScanner.java:101)
   at org.jboss.seam.deployment.URLScanner.scanResources(URLScanner.java:84)
   at org.jboss.seam.deployment.StandardDeploymentStrategy.scan(StandardDeploymentStrategy.java:105)
   at org.jboss.seam.init.Initialization.create(Initialization.java:122)
   at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
   at org.alfresco.catalina.context.AVMStandardContext.start(AVMStandardContext.java:73)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at org.alfresco.catalina.host.AVMHostConfig.deployAVMdirectory(AVMHostConfig.java:1675)
   at org.alfresco.catalina.host.AVMHostConfig.deployAVMWebapp(AVMHostConfig.java:1472)
   at org.alfresco.catalina.host.AVMHostConfig.deployAVMWebappDescriptorTree(AVMHostConfig.java:1298)
   at org.alfresco.catalina.host.AVMHostConfig.deployAVMWebappDescriptorTree(AVMHostConfig.java:1307)
   at org.alfresco.catalina.host.AVMHostConfig.deployAVMWebappsInDependencyOrder(AVMHostConfig.java:1291)
   at org.alfresco.catalina.host.AVMHostConfig.deployAllAVMwebappsInRepository(AVMHostConfig.java:436)
   at org.alfresco.catalina.host.AVMHostConfig.deployApps(AVMHostConfig.java:242)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at org.alfresco.catalina.host.AVMHostConfig.start(AVMHostConfig.java:194)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.alfresco.catalina.host.AVMHost.start(AVMHost.java:772)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: java.util.zip.ZipException: error in opening zip file
   at java.util.zip.ZipFile.open(Native Method)
   at java.util.zip.ZipFile.<init>(ZipFile.java:114)
   at java.util.zip.ZipFile.<init>(ZipFile.java:131)
   at org.jboss.seam.deployment.URLScanner.handleArchiveByFile(URLScanner.java:117)
   … 36 more

Seams scans the WEB-INF/lib and WEB-INF/classes in search for Seam components. It seems that it can not handle the way Alfresco publishes the website to the virtualization server.

Has anyone any good tips/ideas for me to analyze this case further? I would appreciate some info also on how Alfresco publishes the website to a virtualization server. With this info I can maybe find a solution (like replacing the Seam servlet listener with an own implementation).

Thanks!

gr. Martin

mtaal
Champ in-the-making
Champ in-the-making
And forgot to mention this, to solve two other stack traces in the catalina.out (related to EL expressions), you have to add the following jars:
el-api.jar
el-ri.jar
to the virtual_tomcat/common/lib directory. You can find these jars in the lib directory of the downloaded Seam release.

gr. Martin

mtaal
Champ in-the-making
Champ in-the-making
And to further give more info in my own post. Seam executes this if statement:
            File file = new File(urlPath);
            if ( file.isDirectory() )
            {
               handleDirectory(file, null);
            }
            else
            {
               handleArchiveByFile(file);
            }

Apparently, file.isDirectory() returns false for the directory: /media/alfresco/cifs/v/test3–admin/VERSION/v-1/DATA/www/avm_webapps/ROOT/WEB-INF/classes

I hope someone can tell me how/why this directory is not seen as a directory by java (or the File object).
Any help is appreciated, thanks!

gr. Martin