1 2 Previous Next 18 Replies Latest reply on Feb 28, 2007 10:35 AM by Michael Yuan

    need to specify the whole package name with org.jboss.seam.c

    asaf sh Expert

      Hey,

      in my facelets files, I have to specify the full package name in order to use seam's objects (such as messages/languageSelector/etc...)

      so
      <h:outputText value = "#{messages}"/>

      prints nothing while

      <h:outputText value = "#{org.jboss.seam.core.messages}"/>
      will find seam's messages array



      Is there any way to solve this issue? specifying everytime the whole package is annoying :-/


      (I use seam based on Glassfish if that makes any different)

      Thanks

        • 1. Re: need to specify the whole package name with org.jboss.se
          Gavin King Master

          This should definitely not be necessary. There is a META-INF/components.xml file in the seam jar. Do you see this getting scanned at startup time?

          • 2. Re: need to specify the whole package name with org.jboss.se
            asaf sh Expert

            Hey,

            When the file should be scanned? when server loads?
            I can see the file exits with all factory tags, but GF logs nothing about it.


            Thanks...

            • 3. Re: need to specify the whole package name with org.jboss.se
              Gavin King Master

              It should be in the Seam startup log.

              • 4. Re: need to specify the whole package name with org.jboss.se
                asaf sh Expert

                Which should be located where?

                Does Seam use Jboss's log facilities? under GF I cant see any seam logs files, nor any seam logging via server logs.


                thanks.

                • 5. Re: need to specify the whole package name with org.jboss.se
                  Michael Yuan Novice

                  Seam uses Log4J for logging. It is kinda tough to get Log4J working in Glassfish. Maybe this thread would help:

                  https://glassfish.dev.java.net/servlets/ReadMsg?list=users&msgNo=590

                  As for your original problem, have you tried the "examples/glassfish" example app? Does it display the messages in register.xhtml etc. correctly?

                  • 6. Re: need to specify the whole package name with org.jboss.se
                    asaf sh Expert

                    hey,

                    GF sample app not getting deployed correctly,

                    re-compiled and tried to deploy the ear file throws errors in GF logs,
                    this happens with 1.1.7.RC1 and GF build 32,



                    following is the full stack trace,

                    [#|2007-02-23T01:49:37.616+0200|WARNING|sun-appserver-ee9.1|javax.enterprise.system.stream.err|_ThreadID=47;_ThreadName=Thread-408;_RequestID=e7b27dd0-5a63-4d9e-b78e-6308e2aa3b5e;|
                    java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
                     at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)
                     at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:173)
                     at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
                     at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
                     at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
                     at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
                     at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
                     at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
                     at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
                     at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:107)
                     at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
                     at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
                     at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
                     at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
                     at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
                     at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269)
                     at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
                     at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
                     at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
                     at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
                     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
                     at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)
                     at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
                     at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:136)
                     at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:71)
                     at com.sun.enterprise.server.AbstractLoader.loadPersistenceUnits(AbstractLoader.java:847)
                     at com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:179)
                     at com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:113)
                     at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:323)
                     at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:197)
                     at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:632)
                     at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:903)
                     at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:887)
                     at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:445)
                     at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:160)
                     at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:295)
                     at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:206)
                     at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:285)
                     at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:119)
                     at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
                     at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:892)
                     at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:564)
                     at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:608)
                     at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:728)
                     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 com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:353)
                     at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:336)
                     at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:448)
                     at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
                     at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
                     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
                     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
                     at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:77)
                     at $Proxy1.invoke(Unknown Source)
                     at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:297)
                     at com.sun.enterprise.deployment.client.DeploymentClientUtils.startApplication(DeploymentClientUtils.java:132)
                     at com.sun.enterprise.deployment.client.DeployAction.run(DeployAction.java:524)
                     at java.lang.Thread.run(Thread.java:595)
                    |#]
                    



                    It is kinda getting out of the post scope but I assume it is important anyway.


                    Any other suggestions why 'META-INF/components.xml' not scanned ?

                    Thanks

                    • 7. Re: need to specify the whole package name with org.jboss.se
                      asaf sh Expert

                      Back to this,

                      Some 'cglib' versions didnt work correctly,

                      Anyway two things:

                      1) GF sample has no usage of messages, in register.xhtml/other files all titles are statically written in the facelets files, also I tried to add some component names into the sample files, but as it didnt work for me, they do not work on the same without the full package path,

                      and I just got remembered, with very old Seam versions it worked fine. it stopped worked in one of my upgrades.


                      2) also, the sample doesnt work correctly, it doesnt find classes, etc...
                      Does anyone manage/take care to update the GF sample?


                      Thanks,


                      Asaf.

                      • 8. Re: need to specify the whole package name with org.jboss.se
                        Gavin King Master

                        The version of examples/glassfish in current CVS has been tested on glassfish and works Just Great.

                        • 9. Re: need to specify the whole package name with org.jboss.se
                          asaf sh Expert

                          Any comments on which GF version it was tested?


                          Anyway, back to the original issue,

                          any component names written in components.xml are not valid with the booking gf sample as well,


                          Thanks,

                          Asaf.

                          • 10. Re: need to specify the whole package name with org.jboss.se
                            Gavin King Master

                            Get the version from CVS.

                            • 11. Re: need to specify the whole package name with org.jboss.se
                              asaf sh Expert

                              Better,

                              Looks like there's an issue with the xml components file of seam's jar file.

                              Following is the stack trace,

                              [#|2007-02-23T06:22:57.413+0200|SEVERE|sun-appserver-ee9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;_RequestID=06c4caa0-8019-44cf-8f5f-3c165cf6b171;|WebModule[/jboss-seam-glassfish]PWC1275: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
                              java.lang.RuntimeException: error while reading file:/opt/glassfish/domains/domain1/applications/j2ee-apps/jboss-seam-glassfish/jboss-seam_jar/META-INF/components.xml
                               at org.jboss.seam.init.Initialization.initComponentsFromXmlDocuments(Initialization.java:112)
                               at org.jboss.seam.init.Initialization.<init>(Initialization.java:83)
                               at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
                               at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4414)
                               at org.apache.catalina.core.StandardContext.start(StandardContext.java:5069)
                               at com.sun.enterprise.web.WebModule.start(WebModule.java:299)
                               at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:960)
                               at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:944)
                               at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:662)
                               at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1549)
                               at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1192)
                               at com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContainer.java:1117)
                               at com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:128)
                               at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:208)
                               at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:204)
                               at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:332)
                               at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)
                               at com.sun.enterprise.server.PEMain.run(PEMain.java:326)
                               at com.sun.enterprise.server.PEMain.main(PEMain.java:260)
                               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 com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)
                              Caused by: org.dom4j.DocumentException: jboss.com Nested exception: jboss.com
                               at org.dom4j.io.SAXReader.read(SAXReader.java:353)
                               at org.dom4j.io.SAXReader.read(SAXReader.java:264)
                               at org.jboss.seam.util.XML.getRootElement(XML.java:16)
                               at org.jboss.seam.init.Initialization.initComponentsFromXmlDocuments(Initialization.java:108)
                               ... 23 more
                              |#]
                              
                              



                              Many thanks.

                              • 12. Re: need to specify the whole package name with org.jboss.se
                                Gavin King Master

                                If glassfish is trying to validate the XML file, then it would need to have access to the internet.

                                • 13. Re: need to specify the whole package name with org.jboss.se
                                  asaf sh Expert

                                  Eh, that was a silly issue,

                                  Well, everything works perfectly. components.xml gets scanned with the latest CVS version,


                                  Except one minor issue the 'logout' button which throws an exception, so just FYI guys...


                                  Gavin many thanks!



                                  (following is the stack trace of the 'logout' button, just in case)

                                  Exception during request processing: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'login' resolved to null
                                  
                                  com.sun.el.parser.AstValue.getTarget(AstValue.java:67)
                                  com.sun.el.parser.AstValue.invoke(AstValue.java:153)
                                  com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
                                  com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
                                  org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
                                  org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
                                  org.jboss.seam.core.Expressions$2.invoke(Expressions.java:106)
                                  org.jboss.seam.core.Pages.callAction(Pages.java:466)
                                  org.jboss.seam.core.Pages.enterPage(Pages.java:275)
                                  org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:242)
                                  org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:193)
                                  org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:57)
                                  com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:218)
                                  com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                                  javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                                  org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
                                  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
                                  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
                                  org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
                                  org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                                  org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                                  org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
                                  org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                                  org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
                                  org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                                  org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
                                  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:217)
                                  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
                                  org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
                                  org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
                                  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:217)
                                  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
                                  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
                                  org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
                                  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
                                  org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
                                  com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
                                  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:186)
                                  org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
                                  org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
                                  org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1067)
                                  org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
                                  org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
                                  org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
                                  org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1067)
                                  org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:252)
                                  com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:618)
                                  com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:549)
                                  com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:790)
                                  com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326)
                                  com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:248)
                                  com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:199)
                                  com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
                                  com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:93)
                                  


                                  Yet again, many thanks.

                                  • 14. Re: need to specify the whole package name with org.jboss.se
                                    Gavin King Master

                                    Yeah, it should be #{identity.logout}, not #{login.logout}.

                                    1 2 Previous Next