users@glassfish.java.net

Re: Script Entity Beans using Groovy

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Fri, 30 May 2008 14:01:17 -0700

Hi Hans,

I am not very familiar with use of scripting languages. Quick web search
gave following links. They seem to be discussing about using JPA +
Groovy outside container but may give you some hints.
http://www.curious-creature.org/2007/03/23/jpa-and-groovy/
http://www.curious-creature.org/2007/03/25/persistence-made-easy-with-groovy-and-jpa/

Meanwhile, it would be helpful if you can post some more details about
your environment and what errors you are getting (like a stack trace)

Thanks,
Mitesh

Vivek Pandey wrote:
> There is JSF groovy support that enables you writing JSF components
> and managed beans in groovy. See Ryan's blog[1] that details the
> approach. Here he is using a servlet filter to process the groovy
> scripts, under the hood it uses GroovyScriptEngine to interpret the
> groovy scripts.
>
> I am not sure but you can try by creating GroovyScriptEngine[2] with
> the thread contextClassLoader frm inside the filter and write your own
> classloader that is used to load the Persistence class and create
> EntityManager from it. Mitesh or someone from JPA team can confirm
> this approach but I think this should work.
>
> I would like to know how it goes...
>
> -vivek.
>
> [1]http://blogs.sun.com/rlubke/entry/groovy_mojarra
> [2]http://groovy.codehaus.org/api/groovy/util/GroovyScriptEngine.html
>
> glassfish_at_javadesktop.org wrote:
>> Hi,
>>
>> We are currently doing a pilot project using Java EE and Glassfish.
>> Something we would like to do is to be able to write some of the
>> Entity beans using a scripting language. I have had a look at groovy
>> and seen some examples of it being used with JPA in a standalone java
>> application.
>> I cannot get this working in Glassfish as the scripted classes cannot
>> be found when deploying the application.
>>
>> I have tried a few things like creating a LicecycleListener where I
>> load the classes at server startup.
>> I can then load them using the GroovyClassloader, but the
>> EJBClassloader cannot find them.
>> Is this at all possible to achieve using Glassfish?
>>
>> Thanks for your help
>>
>> Hans
>> [Message sent by forum member 'hansflhotmailcom' (hansflhotmailcom)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=277521
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>