You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Stanczak Group <ju...@stanczakgroup.com> on 2005/07/12 13:10:31 UTC

Loading Files?

I've written a servlet with HiveMind and Tapestry that needs to load a
file for parsing. Usually I would do this:

context.getServlet().getServletContext().getResourceAsStream("filename");

I've tried just using the:

this.getClass().getResourceAsStream("filename");

But I can't seem to get that to work and the first method references the
servlet. What's the proper way to do this the HiveMind way? Thanks.

-- 
Justin Stanczak
Stanczak Group
812-735-3600

"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke

..________...............__.................
./  _____/..____..._____/..|_..____...____....
/...\..____/.__.\./....\...__\/.._.\./._..\....
\....\_\..\..___/|...|..\..|.(..<_>.|.<_>..)....
.\______../\___.._\__|../__|..\____/.\____/......
........\/.....\/.....\/..........................


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Security Ejbs lookup

Posted by Achim Hügen <ac...@gmx.de>.
It may be easier to override the NameLookup service.
Look here for details: http://jakarta.apache.org/hivemind/override.html

Achim

Am Wed, 13 Jul 2005 17:49:02 -0300 schrieb Pablo Lalloni 
<pl...@afip.gov.ar>:

> El Mié 13 Jul 2005 15:16, Carlos Lizarralde escribió:
>> I have the same problem!
>>
>> Any clues?
>
> Currently JNDI lookups are done through hivemind.lib.NameLookup service 
> which
> doesn't support properties out of java.naming.factory.initial,
> java.naming.factory.url.pkgs and java.naming.factory.provider.url 
> contributed
> to be contributed.
>
> I think your best shot is to implement your own NameLookup service that
> accepts custom properties as contribution and then setup an 
> EJBProxyFactory
> (copy&paste from hivemind-lib's hivemodule.xml) service with your 
> NameLookup
> injected in place of hivemind.lib.NameLookup.
>
> Then you can use this new EJBProxyFactory of your own for accessing your 
> EJBs.
>
> Maybe this improvements to NameLookupImpl can be incorporated into
> hivemind-lib's one.
>



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Security Ejbs lookup

Posted by Pablo Lalloni <pl...@afip.gov.ar>.
El Mié 13 Jul 2005 15:16, Carlos Lizarralde escribió:
> I have the same problem!
>
> Any clues?

Currently JNDI lookups are done through hivemind.lib.NameLookup service which 
doesn't support properties out of java.naming.factory.initial, 
java.naming.factory.url.pkgs and java.naming.factory.provider.url contributed 
to be contributed.

I think your best shot is to implement your own NameLookup service that 
accepts custom properties as contribution and then setup an EJBProxyFactory 
(copy&paste from hivemind-lib's hivemodule.xml) service with your NameLookup 
injected in place of hivemind.lib.NameLookup.

Then you can use this new EJBProxyFactory of your own for accessing your EJBs.

Maybe this improvements to NameLookupImpl can be incorporated into 
hivemind-lib's one.

-- 
Pablo I. Lalloni

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


RE: Security Ejbs lookup

Posted by Carlos Lizarralde <cl...@cubika.com>.
I have the same problem! 

Any clues?

 

  _____  

De: Mariano Stampella [mailto:mstampella@gmail.com] 
Enviado el: Miércoles, 13 de Julio de 2005 11:22 a.m.
Para: hivemind-user@jakarta.apache.org
Asunto: Security Ejbs lookup

 

Hi,

 

I need lookup session beans with some security parameters like:

 

SECURITY_PRINCIPAL = "root"

SECURITY_CREDENTIALS = "blablabla"

 

When I do the manual lookup i´m just write:

 

Hashtable props = new H....

 

props.put(javax.naming.Context.SECURITY_PRINCIPAL...)

 

Context context = new InitialContext(props);

 

But when I use invoke-factory: 

 

 

  <service-point id="tratamientoRechazosSession"
interface="com.np.iaso.mamo.interfaces.TratamientoRechazos">

       <invoke-factory service-id="hivemind.lib.EJBProxyFactory">

       <construct
home-interface="com.np.iaso.mamo.interfaces.TratamientoRechazosHome"

          jndi-name="ejb/TratamientoRechazos" />

     </invoke-factory>

  </service-point>

 

 

How can I set this parameters?????

 

 

Sorry for my English :-(

 

Mariano


Security Ejbs lookup

Posted by Mariano Stampella <ms...@gmail.com>.
Hi,

 

I need lookup session beans with some security parameters like:

 

SECURITY_PRINCIPAL = "root"

SECURITY_CREDENTIALS = "blablabla"

 

When I do the manual lookup i´m just write:

 

Hashtable props = new H....

 

props.put(javax.naming.Context.SECURITY_PRINCIPAL...)

 

Context context = new InitialContext(props);

 

But when I use invoke-factory: 

 

 

  <service-point id="tratamientoRechazosSession"
interface="com.np.iaso.mamo.interfaces.TratamientoRechazos">

       <invoke-factory service-id="hivemind.lib.EJBProxyFactory">

       <construct
home-interface="com.np.iaso.mamo.interfaces.TratamientoRechazosHome"

          jndi-name="ejb/TratamientoRechazos" />

     </invoke-factory>

  </service-point>

 

 

How can I set this parameters?????

 

 

Sorry for my English :-(

 

Mariano


Re: Loading Files?

Posted by Stanczak Group <ju...@stanczakgroup.com>.
Ok, thanks.

Knut Wannheden wrote:

>You can read about injecting resources on the BuilderFactory page:
>http://jakarta.apache.org/hivemind/hivemind/BuilderFactory.html.
>
>For more similar questions you have to either check the documentation
>or ping the user-list if it's missing in the documentation.
>
>We hope to get around to vastly "refactor" and improve the
>documentation. Input is always welcome:
>http://wiki.apache.org/jakarta-hivemind/DocRevision
>
>Regards,
>
>--knut
>
>On 7/13/05, Stanczak Group <ju...@stanczakgroup.com> wrote:
>  
>
>>Oh really, you don't say. I did not know that. Thanks. Can you tell me
>>how to go about finding that on my own if I have more similar questions?
>>Thanks.
>>
>>Knut Wannheden wrote:
>>
>>    
>>
>>>On 7/12/05, Stanczak Group <ju...@stanczakgroup.com> wrote:
>>>
>>>
>>>      
>>>
>>>>Or maybe have a feature where you can define a resource that gets
>>>>injected as a URL or something. Then you could define resources with
>>>>your module along side your configs and services.
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>Indeed. You can inject a HiveMind Resource object into a service. You
>>>can use the BuilderFactory's <set-resource> element or the
>>><set-object> with the resource: translator. The string will be
>>>interpreted as a relative path (relative to the module descriptor).
>>>
>>>--knut
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>--
>>Justin Stanczak
>>Stanczak Group
>>812-735-3600
>>
>>"All that is necessary for the triumph of evil is that good men do nothing."
>>Edmund Burke
>>
>>..________...............__.................
>>./  _____/..____..._____/..|_..____...____....
>>/...\..____/.__.\./....\...__\/.._.\./._..\....
>>\....\_\..\..___/|...|..\..|.(..<_>.|.<_>..)....
>>.\______../\___.._\__|../__|..\____/.\____/......
>>........\/.....\/.....\/..........................
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>
>  
>

-- 
Justin Stanczak
Stanczak Group
812-735-3600

"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke

..________...............__.................
./  _____/..____..._____/..|_..____...____....
/...\..____/.__.\./....\...__\/.._.\./._..\....
\....\_\..\..___/|...|..\..|.(..<_>.|.<_>..)....
.\______../\___.._\__|../__|..\____/.\____/......
........\/.....\/.....\/..........................


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Loading Files?

Posted by Knut Wannheden <kn...@gmail.com>.
You can read about injecting resources on the BuilderFactory page:
http://jakarta.apache.org/hivemind/hivemind/BuilderFactory.html.

For more similar questions you have to either check the documentation
or ping the user-list if it's missing in the documentation.

We hope to get around to vastly "refactor" and improve the
documentation. Input is always welcome:
http://wiki.apache.org/jakarta-hivemind/DocRevision

Regards,

--knut

On 7/13/05, Stanczak Group <ju...@stanczakgroup.com> wrote:
> Oh really, you don't say. I did not know that. Thanks. Can you tell me
> how to go about finding that on my own if I have more similar questions?
> Thanks.
> 
> Knut Wannheden wrote:
> 
> >On 7/12/05, Stanczak Group <ju...@stanczakgroup.com> wrote:
> >
> >
> >>Or maybe have a feature where you can define a resource that gets
> >>injected as a URL or something. Then you could define resources with
> >>your module along side your configs and services.
> >>
> >>
> >>
> >
> >Indeed. You can inject a HiveMind Resource object into a service. You
> >can use the BuilderFactory's <set-resource> element or the
> ><set-object> with the resource: translator. The string will be
> >interpreted as a relative path (relative to the module descriptor).
> >
> >--knut
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> >
> >
> >
> >
> 
> --
> Justin Stanczak
> Stanczak Group
> 812-735-3600
> 
> "All that is necessary for the triumph of evil is that good men do nothing."
> Edmund Burke
> 
> ..________...............__.................
> ./  _____/..____..._____/..|_..____...____....
> /...\..____/.__.\./....\...__\/.._.\./._..\....
> \....\_\..\..___/|...|..\..|.(..<_>.|.<_>..)....
> .\______../\___.._\__|../__|..\____/.\____/......
> ........\/.....\/.....\/..........................
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Loading Files?

Posted by Stanczak Group <ju...@stanczakgroup.com>.
Oh really, you don't say. I did not know that. Thanks. Can you tell me
how to go about finding that on my own if I have more similar questions?
Thanks.

Knut Wannheden wrote:

>On 7/12/05, Stanczak Group <ju...@stanczakgroup.com> wrote:
>  
>
>>Or maybe have a feature where you can define a resource that gets
>>injected as a URL or something. Then you could define resources with
>>your module along side your configs and services.
>>
>>    
>>
>
>Indeed. You can inject a HiveMind Resource object into a service. You
>can use the BuilderFactory's <set-resource> element or the
><set-object> with the resource: translator. The string will be
>interpreted as a relative path (relative to the module descriptor).
>
>--knut
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>
>  
>

-- 
Justin Stanczak
Stanczak Group
812-735-3600

"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke

..________...............__.................
./  _____/..____..._____/..|_..____...____....
/...\..____/.__.\./....\...__\/.._.\./._..\....
\....\_\..\..___/|...|..\..|.(..<_>.|.<_>..)....
.\______../\___.._\__|../__|..\____/.\____/......
........\/.....\/.....\/..........................


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Loading Files?

Posted by Knut Wannheden <kn...@gmail.com>.
On 7/12/05, Stanczak Group <ju...@stanczakgroup.com> wrote:
> Or maybe have a feature where you can define a resource that gets
> injected as a URL or something. Then you could define resources with
> your module along side your configs and services.
> 

Indeed. You can inject a HiveMind Resource object into a service. You
can use the BuilderFactory's <set-resource> element or the
<set-object> with the resource: translator. The string will be
interpreted as a relative path (relative to the module descriptor).

--knut

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Loading Files?

Posted by Stanczak Group <ju...@stanczakgroup.com>.
Or maybe have a feature where you can define a resource that gets
injected as a URL or something. Then you could define resources with
your module along side your configs and services.

Stanczak Group wrote:

>Achim Hügen wrote:
>
>  
>
>>In which way is HiveMind involved?
>>    
>>
>
>I'm using a service to send the email. The service loads the external
>file for the body of the email.
>
>  
>
>>What do you expect hivemind to do with the file?
>>    
>>
>
>I guess just find the file and pass me a inputstream. Which I understand
>that's what the class loaders do. I was just curious how others where
>doing this when using HiveMind.
>
>  
>
>>Achim
>>
>>Am Tue, 12 Jul 2005 11:10:31 +0000 schrieb Stanczak Group
>><ju...@stanczakgroup.com>:
>>
>>    
>>
>>>I've written a servlet with HiveMind and Tapestry that needs to load a
>>>file for parsing. Usually I would do this:
>>>
>>>context.getServlet().getServletContext().getResourceAsStream("filename");
>>>
>>>
>>>I've tried just using the:
>>>
>>>this.getClass().getResourceAsStream("filename");
>>>
>>>But I can't seem to get that to work and the first method references the
>>>servlet. What's the proper way to do this the HiveMind way? Thanks.
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>  
>

-- 
Justin Stanczak
Stanczak Group
812-735-3600

"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke

..________...............__.................
./  _____/..____..._____/..|_..____...____....
/...\..____/.__.\./....\...__\/.._.\./._..\....
\....\_\..\..___/|...|..\..|.(..<_>.|.<_>..)....
.\______../\___.._\__|../__|..\____/.\____/......
........\/.....\/.....\/..........................


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Loading Files?

Posted by Stanczak Group <ju...@stanczakgroup.com>.
Achim Hügen wrote:

> In which way is HiveMind involved?

I'm using a service to send the email. The service loads the external
file for the body of the email.

> What do you expect hivemind to do with the file?

I guess just find the file and pass me a inputstream. Which I understand
that's what the class loaders do. I was just curious how others where
doing this when using HiveMind.

>
> Achim
>
> Am Tue, 12 Jul 2005 11:10:31 +0000 schrieb Stanczak Group
> <ju...@stanczakgroup.com>:
>
>> I've written a servlet with HiveMind and Tapestry that needs to load a
>> file for parsing. Usually I would do this:
>>
>> context.getServlet().getServletContext().getResourceAsStream("filename");
>>
>>
>> I've tried just using the:
>>
>> this.getClass().getResourceAsStream("filename");
>>
>> But I can't seem to get that to work and the first method references the
>> servlet. What's the proper way to do this the HiveMind way? Thanks.
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>

-- 
Justin Stanczak
Stanczak Group
812-735-3600

"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke

..________...............__.................
./  _____/..____..._____/..|_..____...____....
/...\..____/.__.\./....\...__\/.._.\./._..\....
\....\_\..\..___/|...|..\..|.(..<_>.|.<_>..)....
.\______../\___.._\__|../__|..\____/.\____/......
........\/.....\/.....\/..........................


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Loading Files?

Posted by Achim Hügen <ac...@gmx.de>.
In which way is HiveMind involved?
What do you expect hivemind to do with the file?

Achim

Am Tue, 12 Jul 2005 11:10:31 +0000 schrieb Stanczak Group 
<ju...@stanczakgroup.com>:

> I've written a servlet with HiveMind and Tapestry that needs to load a
> file for parsing. Usually I would do this:
>
> context.getServlet().getServletContext().getResourceAsStream("filename");
>
> I've tried just using the:
>
> this.getClass().getResourceAsStream("filename");
>
> But I can't seem to get that to work and the first method references the
> servlet. What's the proper way to do this the HiveMind way? Thanks.
>



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Loading Files?

Posted by Stanczak Group <ju...@stanczakgroup.com>.
Well I seem to of got the .getResourceAsStream("filename"); to work so
I'm going that direction. If anyone has a better method let me know.

Stanczak Group wrote:

>I've written a servlet with HiveMind and Tapestry that needs to load a
>file for parsing. Usually I would do this:
>
>context.getServlet().getServletContext().getResourceAsStream("filename");
>
>I've tried just using the:
>
>this.getClass().getResourceAsStream("filename");
>
>But I can't seem to get that to work and the first method references the
>servlet. What's the proper way to do this the HiveMind way? Thanks.
>
>  
>

-- 
Justin Stanczak
Stanczak Group
812-735-3600

"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke

..________...............__.................
./  _____/..____..._____/..|_..____...____....
/...\..____/.__.\./....\...__\/.._.\./._..\....
\....\_\..\..___/|...|..\..|.(..<_>.|.<_>..)....
.\______../\___.._\__|../__|..\____/.\____/......
........\/.....\/.....\/..........................


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org