1 2 Previous Next 25 Replies Latest reply on Dec 16, 2007 8:33 PM by starksm64

    vfs issue?

    ccrouch

      Is this a VFS issue?

      http://jira.jboss.com/jira/browse/JBAS-4241

      Cheers
      Charles

        • 1. Re: vfs issue?
          starksm64

          Use of a File is not valid. There is the VFS and nothing else. The url looks to be pointing to a jar nested inside of an ear which will not have a valid File representation. The input stream from the vfs url is what needs to be passed to the ZipInputStream.

          • 2. Re: vfs issue?
            ccrouch

            Ok, so just to be clear. You're saying this is something that needs to be fixed in Seam?

            • 3. Re: vfs issue?
              starksm64

              If its making the assumption that java.io.File is a valid means to access the contents of a deployment, yes, that is wrong.

              • 4. Re: vfs issue?
                gavin.king

                So is there a "quick fix", Scott, or do we need do write a whole Seam deployer? What is the safe way to scan archives in an EAR in JBoss 5?

                • 5. Re: vfs issue?
                  starksm64

                  You would have to use the org.jboss.vfs.VFS/VirtualFile aps. You can't just use the java.net.URL and handler apis because they don't have support for directory structures. A deployer (which is a very isolated/minimal entity in jboss5) may be the better choice to avoid needing to link core seam code to the vfs, although its a standalone piece that has no dependencies on other mc code. It does depend on the jboss common/logging jars.

                  I'd have to know more about what the scan is trying to accomplish and how this relates to jbossas vs another app server to say which is better.

                  • 6. Re: vfs issue?
                    alesj

                    I was able to get past this vfs issue with this change to the Scanner:

                     for ( String urlPath: paths )
                     {
                     try
                     {
                     log.info("scanning: " + urlPath);
                     URL url = new URL(urlPath);
                     File file = new File(urlPath);
                     if ( file.isDirectory() )
                     {
                     handleDirectory(file, null);
                     }
                     else
                     {
                     handleArchive(url);
                     }
                     }
                     catch (IOException ioe)
                     {
                     log.warn("could not read entries", ioe);
                     }
                     }
                     }
                    
                     private void handleArchive(URL url) throws IOException
                     {
                     log.debug("archive: " + url);
                     InputStream inputStream = url.openStream();
                     try
                     {
                     JarInputStream jarInputStream = new JarInputStream(inputStream);
                     ZipEntry entry = jarInputStream.getNextEntry();
                     while ( entry != null )
                     {
                     String name = entry.getName();
                     log.debug("found: " + name);
                     handleItem(name);
                     entry = jarInputStream.getNextEntry();
                     }
                     }
                     finally
                     {
                     inputStream.close();
                     }
                     }
                    


                    But now I get NCDFE:
                    java.lang.RuntimeException: Could not create Component: org.jboss.seam.bpm.businessProcess
                     at org.jboss.seam.init.Initialization.addComponent(Initialization.java:986)
                     at org.jboss.seam.init.Initialization.installComponents(Initialization.java:908)
                     at org.jboss.seam.init.Initialization.init(Initialization.java:553)
                     at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
                     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3850)
                     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4353)
                     at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:344)
                     at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:143)
                     at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:341)
                     at org.jboss.web.deployers.WebModule.startModule(WebModule.java:89)
                     at org.jboss.web.deployers.WebModule.start(WebModule.java:67)
                     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:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                     at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:184)
                     at $Proxy4.start(Unknown Source)
                     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
                     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
                     at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                     at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                     at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                     at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:255)
                     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
                     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
                     at org.jboss.system.ServiceController.doChange(ServiceController.java:659)
                     at org.jboss.system.ServiceController.start(ServiceController.java:431)
                     at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:149)
                     at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:107)
                     at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
                     at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65)
                     at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                     at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:874)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:906)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
                     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
                     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
                     at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
                     at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:245)
                     at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:131)
                     at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:408)
                     at org.jboss.Main.boot(Main.java:208)
                     at org.jboss.Main$1.run(Main.java:534)
                     at java.lang.Thread.run(Thread.java:595)
                    Caused by: java.lang.NoClassDefFoundError: org/jbpm/graph/exe/ProcessInstance
                     at java.lang.Class.getDeclaredMethods0(Native Method)
                     at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
                     at java.lang.Class.getDeclaredMethods(Class.java:1763)
                     at org.jboss.seam.Component.initMembers(Component.java:527)
                     at org.jboss.seam.Component.<init>(Component.java:254)
                     at org.jboss.seam.Component.<init>(Component.java:217)
                     at org.jboss.seam.init.Initialization.addComponent(Initialization.java:971)
                     ... 61 more
                    

                    although this class is in seam-numberguess.ear/lib/jbpm.jar.



                    • 7. Re: vfs issue?
                      alesj

                      I've attached my local Scanner.java to the JIRA issue.

                      • 8. Re: vfs issue?
                        pmuir

                        I can see this too.

                        Another problem:

                        org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/Users/pmuir/workspace/jbossas/build/output/jboss-5.0.0.Beta3/server/default/deploy/jboss-seam-numberguess.ear/jboss-seam-numberguess.war
                         at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
                         at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:175)
                         at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
                         at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:906)
                         at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
                         at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                         at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                         at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                         at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                         at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                         at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
                         at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
                         at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
                         at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
                         at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:245)
                         at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:131)
                         at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:408)
                         at org.jboss.Main.boot(Main.java:208)
                         at org.jboss.Main$1.run(Main.java:534)
                         at java.lang.Thread.run(Thread.java:613)
                        Caused by: java.lang.NoClassDefFoundError: com/sun/facelets/compiler/Compiler
                         at java.lang.Class.getDeclaredFields0(Native Method)
                         at java.lang.Class.privateGetDeclaredFields(Class.java:2232)
                         at java.lang.Class.getDeclaredFields(Class.java:1715)
                         at org.jboss.metadata.annotation.creator.AbstractComponentProcessor.processClass(AbstractComponentProcessor.java:258)
                         at org.jboss.metadata.annotation.creator.AbstractComponentProcessor.processClass(AbstractComponentProcessor.java:208)
                         at org.jboss.metadata.annotation.creator.AbstractComponentProcessor.process(AbstractComponentProcessor.java:149)
                         at org.jboss.metadata.annotation.creator.web.WebComponentProcessor.process(WebComponentProcessor.java:60)
                         at org.jboss.metadata.annotation.creator.web.WebComponentProcessor.process(WebComponentProcessor.java:42)
                         at org.jboss.metadata.annotation.creator.web.Web25MetaDataCreator.create(Web25MetaDataCreator.java:68)
                         at org.jboss.deployment.AnnotationMetaDataDeployer.processJBossWebMetaData(AnnotationMetaDataDeployer.java:190)
                         at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:149)
                         at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:78)
                         at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
                         ... 18 more
                        21:44:02,695 INFO [TomcatDeployment] deploy, ctxPath=/invoker, vfsUrl=http-invoker.sar/invoker.war


                        this occurs on the standard build for the numberguess example, obviously including facelets solves this, but facelets isn't needed for this example

                        • 9. Re: vfs issue?
                          pmuir

                          There is also this problem with deploying the booking example (this is the example we should concentrate on as it shows most core seam functionality without distractions like jbpm).

                          21:06:28,587 INFO [TomcatDeployment] deploy, ctxPath=/invoker,
                          vfsUrl=http-invoker.sar/invoker.war
                          21:06:34,018 ERROR [AbstractKernelController] Error installing to
                          Real: name=vfsfile:/Users/pmuir/workspace/jbossas/build/output/jboss-5.0.0.Beta3/server/default/deploy/jboss-seam-booking.ear
                          state=PostClassLoader mode=Manual requiredState=Real
                          org.jboss.deployers.spi.DeploymentException: Error deploying
                          jboss-seam-booking.jar: Interceptor class not found:
                          org.jboss.seam.ejb.SeamInterceptor
                           at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:158)
                           at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:88)
                           at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
                           at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                           at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
                           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
                           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:906)
                           at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
                           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
                           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
                           at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
                           at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
                           at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:245)
                           at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:131)
                           at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:408)
                           at org.jboss.Main.boot(Main.java:208)
                           at org.jboss.Main$1.run(Main.java:534)
                           at java.lang.Thread.run(Thread.java:613)
                          Caused by: java.lang.RuntimeException: Interceptor class not found:
                          org.jboss.seam.ejb.SeamInterceptor
                           at org.jboss.ejb3.interceptor.InterceptorInfoRepository.loadClass(InterceptorInfoRepository.java:525)
                           at org.jboss.ejb3.interceptor.InterceptorInfoRepository.access$100(InterceptorInfoRepository.java:77)
                           at org.jboss.ejb3.interceptor.InterceptorInfoRepository$AnnotationInitialiser.<init>(InterceptorInfoRepository.java:682)
                           at org.jboss.ejb3.interceptor.InterceptorInfoRepository$XmlInitialiser.<init>(InterceptorInfoRepository.java:813)
                           at org.jboss.ejb3.interceptor.InterceptorInfoRepository.initialiseInfosFromXml(InterceptorInfoRepository.java:367)
                           at org.jboss.ejb3.interceptor.InterceptorInfoRepository.initialise(InterceptorInfoRepository.java:108)
                           at org.jboss.ejb3.Ejb3HandlerFactory$DDFactory.<init>(Ejb3HandlerFactory.java:48)
                           at org.jboss.ejb3.Ejb3HandlerFactory.getInstance(Ejb3HandlerFactory.java:83)
                           at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:431)
                           at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:375)
                           at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:145)
                           ... 22 more
                          21:06:34,116 INFO [RARDeployment] Required license terms exist, view
                          vfsfile:/Users/pmuir/workspace/jbossas/build/output/jboss-5.0.0.Beta3/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml


                          We declare jboss-seam.jar as an ejb module in application.xml - and the SeamInterceptor in ejb-jar.xml.

                          • 10. Re: vfs issue?
                            pmuir

                            And, obviously, jboss-seam.jar contains the SeamInterceptor class.

                            • 11. Re: vfs issue?
                              pmuir

                               

                              "alesj" wrote:
                              I was able to get past this vfs issue with this change to the Scanner:


                              I still think a deployer is a better solution as (as I understand it) there should be some speed improvements as Seam doesn't have to scan for annotations as this has been done by the AS.

                              We should consider this issue in conjunction http://jira.jboss.com/jira/browse/JBSEAM-1342
                              - a way to call a handler based on some other metadata other than the @Name annotation (e.g. other annotation, file name pattern etc.). This obviously need to be portable across app servers.

                              • 12. Re: vfs issue?
                                pmuir

                                The (very) aggressive classloading has got worse. To get the booking example to the point of failing on not being able to load the SeamInterceptor I now have to add the following to server/default/lib (adding them to the ear/lib doesn't work). Seam is a dead duck on AS 5 until this can be fixed.

                                jbpm-jpdl.jar
                                drools-core.jar
                                drools-compiler.jar
                                jboss-cache.jar
                                jgroups.jar
                                jsf-facelets.jar (if not included in the example's WEB-INF/lib)

                                • 13. Re: vfs issue?
                                  maxandersen

                                  as much as I would love seeing an optimized deployer for seam I also would love that we didn't need to have N different ways to setup deployment for N servers. If we could at least get the normal scanning which works on all app servers (afaik) expect JB5 working on JB5 and then optionally have the choice of getting better speed by enabling the deployer that would be the best.

                                  I still do not understand why the vfs url's can't present their inputstream as an jar archive ?

                                  • 14. Re: vfs issue?
                                    maxandersen

                                    sorry I misread the change...looks like it *now* is exposed as an jar archive. sorry for the noise!

                                    1 2 Previous Next