Sorry Christian, saw your mail only now. 

You solution makes perfect sense. Didn't know JBoss AS tries to start CDI with 
not having all the ClassPath in place. I sense some more problems will hit you 
in this case. What JBossAS version do you use exactly? I would report this 
issue to the JBoss team. Guess they are happy about such a feedback!

LieGrue,
strub




----- Original Message -----
> From: Christian Beikov <christian.bei...@gmail.com>
> To: users@myfaces.apache.org
> Cc: 
> Sent: Friday, September 7, 2012 7:36 AM
> Subject: Re: MyFaces CODI within EAR
> 
> Well, it took me some time, but I figured out that JBoss AS does not add the 
> JSF 
> stuff to the classpath when starting CODI. The solution for JBoss AS7 to get 
> CODI working when located in EAR/lib finally is:
> 
> Add a jboss-deployment-structure.xml file to EAR/META-INF that looks like 
> this:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <jboss-deployment-structure>
>     <!-- Make sub deployments isolated by default, so they cannot see each 
> others
>         classes without a Class-Path entry -->
> <ear-subdeployments-isolated>true</ear-subdeployments-isolated>
>     <!-- This corresponds to the top level deployment. For a war this is the
>         war's module, for an ear -->
>     <!-- This is the top level ear module, which contains all the classes in
>         the EAR's lib folder -->
>     <deployment>
>         <!-- This allows you to define additional dependencies, it is the 
> same
>             as using the Dependencies: manifest attribute -->
>         <dependencies>
>             <module name="org.w3c.css.sac" />
>             <module name="net.sourceforge.cssparser" />
>             <module name="com.sun.jsf-impl" />
>             <module name="javax.api" />
>             <module name="javax.faces.api" />
>             <module name="javax.xml.bind.api" />
>             <module name="javax.xml.jaxp-provider" />
>             <module name="com.google.guava" />
>         </dependencies>
>     </deployment>
> </jboss-deployment-structure>
> 
> This will make everything that is somehow jsf specific available for the CODI 
> jar. Hope this might help someone else.
> 
> Regards,
> Christian
> 
> Am 06.09.2012 22:29, schrieb Mark Struberg:
>>  Hi christian!
>> 
>>  Yes, this is perfectly possible. You just have to move all your JSF deps 
> which are needed by CODI to a shared jar  (in an EAR lib).
>>  myfaces-api.jar myfaces-impl.jar, el, etc. All the stuff which is 
> (transitively) required on the classpath.
>> 
>>  I have this scenario running over here with 12 webapps in an EAR (with 
> ClassLoader isolation).
>> 
>> 
>>  LieGrue,
>>  strub
>> 
>> 
>> 
>> 
>>  ----- Original Message -----
>>>  From: Christian Beikov <christian.bei...@gmail.com>
>>>  To: MyFaces Discussion <users@myfaces.apache.org>
>>>  Cc:
>>>  Sent: Thursday, September 6, 2012 10:06 PM
>>>  Subject: MyFaces CODI within EAR
>>> 
>>>  Hello!
>>> 
>>>  I am trying to package the codi jsf 2 bundle 1.0.5 within my ear but I 
> am
>>>  getting some exceptions like:
>>> 
>>>  java.lang.NoClassDefFoundError: javax/faces/bean/ViewScoped
>>> 
>>>  I have placed the bundle in EAR/lib since I have 2 Webapps that use 
> CODI.
>>>  Is it even possible to use CODI in such a scenario? Could you please 
> provide
>>>  some details on how CODI is supposed to be packaged within an EAR?
>>> 
>>>  Regards,
>>>  Christian
>>> 
>

Reply via email to