You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@deltaspike.apache.org by Thomas Kernstock <t....@e-technologies.at> on 2016/10/04 10:59:27 UTC

Projectstage -> JNDI - Third Try

Sorry guys,

I don't want to bug you but its seems that all images and attachments are removed from my mails.

I would like to configure the Deltaspike ProjectStage via JNDI as Custom resource on Payara 4.1 but it doesn't get picked up. I tried two different configurations:

1) <custom-resource factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory" res-type="java.lang.String" jndi-name="deltaspike/ProjectStage">
              <property name="value" value="Development"></property>
    </custom-resource>

2) In combination with an entry in Web.xml - similar to the configuration for the jsf/ProjectStage:

    <custom-resource factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory" res-type="java.lang.String" jndi-name="org.apache.deltaspike.ProjectStage">
      <property name="value" value="UnitTest"></property>
    </custom-resource>


<resource-ref>
    <res-ref-name>deltaspike/ProjectStage</res-ref-name>
    <res-type>java.lang.String</res-type>
    <mapped-name>org.apache.deltaspike.ProjectStage</mapped-name>
</resource-ref>


To make sure my environment and my tests work, I also tried to set the stage with a JVM Parameter. This works.

Also setting the JSF ProjectStage works fine in Payara

   <custom-resource factory-class="com.sun.faces.application.ProjectStageJndiFactory" res-type="java.lang.String" jndi-name="javax.faces.PROJECT_STAGE">
      <property name="stage" value="Development"></property>
    </custom-resource>

in combination with Web.xml

<resource-ref>
    <res-ref-name>jsf/ProjectStage</res-ref-name>
    <res-type>java.lang.String</res-type>
    <mapped-name>javax.faces.PROJECT_STAGE</mapped-name>
</resource-ref>



So the question is what is wrong with my Deltaspike configuration. Any ideas?

best regards
Thomas


AW: Projectstage -> JNDI - Third Try

Posted by Thomas Kernstock <t....@e-technologies.at>.
Hi John,

thank you for your reply. I'm not sure if I need a provider because when I read the documentation of Deltaspike under https://deltaspike.apache.org/documentation/projectstage.html
it says that the ConfigResover searches for a String -> 
"-Dorg.apache.deltaspike.ProjectStage=Development"

Since the ConfigResolver works with JNDI, Propertiefiles, JVM Arguments etc. I assumed, that with the correct JNDI Configuration in glassfish, it should work with no further producers etc.

br
Thomas


-----Ursprüngliche Nachricht-----
Von: John D. Ament [mailto:johndament@apache.org] 
Gesendet: Dienstag, 04. Oktober 2016 16:37
An: users@deltaspike.apache.org
Betreff: Re: Projectstage -> JNDI - Third Try

Hi Thomas,

I'm not too familiar with this type of usage.  However, ProjectStage is a concrete type in DeltaSpike, not a string.  That might be part of it.  You may also need to provide a producer method.

John

On Tue, Oct 4, 2016 at 6:59 AM Thomas Kernstock < t.kernstock@e-technologies.at> wrote:

> Sorry guys,
>
> I don't want to bug you but its seems that all images and attachments 
> are removed from my mails.
>
> I would like to configure the Deltaspike ProjectStage via JNDI as 
> Custom resource on Payara 4.1 but it doesn't get picked up. I tried 
> two different
> configurations:
>
> 1) <custom-resource
> factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory"
> res-type="java.lang.String" jndi-name="deltaspike/ProjectStage">
>               <property name="value" value="Development"></property>
>     </custom-resource>
>
> 2) In combination with an entry in Web.xml - similar to the 
> configuration for the jsf/ProjectStage:
>
>     <custom-resource
> factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory"
> res-type="java.lang.String" jndi-name="org.apache.deltaspike.ProjectStage">
>       <property name="value" value="UnitTest"></property>
>     </custom-resource>
>
>
> <resource-ref>
>     <res-ref-name>deltaspike/ProjectStage</res-ref-name>
>     <res-type>java.lang.String</res-type>
>     <mapped-name>org.apache.deltaspike.ProjectStage</mapped-name>
> </resource-ref>
>
>
> To make sure my environment and my tests work, I also tried to set the 
> stage with a JVM Parameter. This works.
>
> Also setting the JSF ProjectStage works fine in Payara
>
>    <custom-resource
> factory-class="com.sun.faces.application.ProjectStageJndiFactory"
> res-type="java.lang.String" jndi-name="javax.faces.PROJECT_STAGE">
>       <property name="stage" value="Development"></property>
>     </custom-resource>
>
> in combination with Web.xml
>
> <resource-ref>
>     <res-ref-name>jsf/ProjectStage</res-ref-name>
>     <res-type>java.lang.String</res-type>
>     <mapped-name>javax.faces.PROJECT_STAGE</mapped-name>
> </resource-ref>
>
>
>
> So the question is what is wrong with my Deltaspike configuration. Any 
> ideas?
>
> best regards
> Thomas
>
>

Re: Projectstage -> JNDI - Third Try

Posted by "John D. Ament" <jo...@apache.org>.
Hi Thomas,

I'm not too familiar with this type of usage.  However, ProjectStage is a
concrete type in DeltaSpike, not a string.  That might be part of it.  You
may also need to provide a producer method.

John

On Tue, Oct 4, 2016 at 6:59 AM Thomas Kernstock <
t.kernstock@e-technologies.at> wrote:

> Sorry guys,
>
> I don't want to bug you but its seems that all images and attachments are
> removed from my mails.
>
> I would like to configure the Deltaspike ProjectStage via JNDI as Custom
> resource on Payara 4.1 but it doesn't get picked up. I tried two different
> configurations:
>
> 1) <custom-resource
> factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory"
> res-type="java.lang.String" jndi-name="deltaspike/ProjectStage">
>               <property name="value" value="Development"></property>
>     </custom-resource>
>
> 2) In combination with an entry in Web.xml - similar to the configuration
> for the jsf/ProjectStage:
>
>     <custom-resource
> factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory"
> res-type="java.lang.String" jndi-name="org.apache.deltaspike.ProjectStage">
>       <property name="value" value="UnitTest"></property>
>     </custom-resource>
>
>
> <resource-ref>
>     <res-ref-name>deltaspike/ProjectStage</res-ref-name>
>     <res-type>java.lang.String</res-type>
>     <mapped-name>org.apache.deltaspike.ProjectStage</mapped-name>
> </resource-ref>
>
>
> To make sure my environment and my tests work, I also tried to set the
> stage with a JVM Parameter. This works.
>
> Also setting the JSF ProjectStage works fine in Payara
>
>    <custom-resource
> factory-class="com.sun.faces.application.ProjectStageJndiFactory"
> res-type="java.lang.String" jndi-name="javax.faces.PROJECT_STAGE">
>       <property name="stage" value="Development"></property>
>     </custom-resource>
>
> in combination with Web.xml
>
> <resource-ref>
>     <res-ref-name>jsf/ProjectStage</res-ref-name>
>     <res-type>java.lang.String</res-type>
>     <mapped-name>javax.faces.PROJECT_STAGE</mapped-name>
> </resource-ref>
>
>
>
> So the question is what is wrong with my Deltaspike configuration. Any
> ideas?
>
> best regards
> Thomas
>
>