henrichen / zkcdi

Automatically exported from code.google.com/p/zkcdi
0 stars 0 forks source link

ZKCDI problems with glassfish #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I tried the smalltalk "Getting started with ZK CDI" with glassfish. I used the 
index.zul and the HelloWorld.java as in the Smalltalk.
When i startup glassfish i get the following DeploymentException:

INFO: WEB0671: Loading application  at 
SCHWERWIEGEND: Exception while loading the app
org.glassfish.deployment.common.DeploymentException: WELD-001408 Injection 
point has unsatisfied dependencies.  Injection point:  field 
net.empego.cdi.test.HelloWorld.guestName;  Qualifiers:  
[@org.zkoss.cdi.inject.ComponentId(value=guestName)]
    at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:181)
    at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:125)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:252)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:360)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:203)
...

Weld tries to resolve the dependencies at startup, but the injected components 
are evaluated in the first place when the zul is rendered. I'm not shure how 
this should work.

I have an empty beans.xml in WEB-INF:

<beans>
</beans>

I dont have any additional config in web.xml since glassfish v3 supports cdi:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://java.sun.com/xml/ns/j2ee" 
xmlns:javaee="http://java.sun.com/xml/ns/javaee" 
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <listener>
    <javaee:description>ZK listener for cleanup when a session is destroyed</javaee:description>
    <javaee:listener-class>org.zkoss.zk.ui.http.HttpSessionListener</javaee:listener-class>
  </listener>
  <servlet>
    <javaee:description>ZK loader for evaluating ZUML pages</javaee:description>
    <servlet-name>zkLoader</servlet-name>
    <servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
    <init-param>
      <javaee:param-name>update-uri</javaee:param-name>
      <javaee:param-value>/zkau</javaee:param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>zkLoader</servlet-name>
    <url-pattern>*.zul</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>zkLoader</servlet-name>
    <url-pattern>*.zhtml</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>zkLoader</servlet-name>
    <url-pattern>/zk/*</url-pattern>
  </servlet-mapping>
  <servlet>
    <javaee:description>The asynchronous update engine for ZK</javaee:description>
    <servlet-name>auEngine</servlet-name>
    <servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>auEngine</servlet-name>
    <url-pattern>/zkau/*</url-pattern>
  </servlet-mapping>

    <!-- Weld configuration -->
<!--    <listener>-->
<!--       
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>-->
<!--    </listener>-->
<!--    <listener>-->
<!--       
<listener-class>org.jboss.weld.el.WeldELContextListener</listener-class>-->
<!--    </listener>-->

  <mime-mapping>
    <extension>gif</extension>
    <mime-type>image/gif</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>htm</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>jad</extension>
    <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>jpeg</extension>
    <mime-type>image/jpeg</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>jpg</extension>
    <mime-type>image/jpeg</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>js</extension>
    <mime-type>application/x-javascript</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>png</extension>
    <mime-type>image/png</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>xml</extension>
    <mime-type>text/xml</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>zhtml</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>zul</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>
  <welcome-file-list>
    <welcome-file>index.zul</welcome-file>
    <welcome-file>index.zhtml</welcome-file>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
  </welcome-file-list>

<!--    <resource-env-ref>-->
<!--            <resource-env-ref-name>BeanManager</resource-env-ref-name>-->
<!--            <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-
env-ref-type>-->
<!--    </resource-env-ref>-->

</web-app>

Original issue reported on code.google.com by oberinsp...@googlemail.com on 22 Aug 2010 at 7:20

GoogleCodeExporter commented 9 years ago
Issue 4 has been merged into this issue.

Original comment by ashish.dasnurkar on 26 May 2011 at 6:57