You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ulf Sahlin <ul...@s2communications.se> on 2004/03/14 01:51:44 UTC

woody, flowscript and ejb

Hello!

Can someone please post a working implementation of an EJB lookup from
within Woody's binding.js flowscript (i.e. the ugly Home lookup onto the
findByPrimaryKey stuff)? I'm having difficulties with the (javascript-style)
syntax and I cannot seem to find a good resource for reference nor good
examples. Currently I'm having issues with the myhome.class narrowing part.
I've tried with myhome["class"] to avoid the reserved keyword issue but I'm
still having problems. The error i get is:

--- class "<myhome>" has no public instance field or method named "class".

I guess I have some issues with package importing or something. It's working
great if I use the bean setters manually and load the form with that bean.


 Cheers,
    Ulf Sahlin


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


SV: woody, flowscript and ejb

Posted by Ulf Sahlin <ul...@s2communications.se>.
Thank you Chris, you rock my sunday morning! It works excellent.

Kind regards,
  Ulf Sahlin


> -----Ursprungligt meddelande-----
> Från: Christopher Oliver [mailto:res1cf5x@verizon.net]
> Skickat: den 14 mars 2004 02:44
> Till: users@cocoon.apache.org
> Ämne: Re: woody, flowscript and ejb
>
>
> Try something like this:
>
>    importPackage(Packages.javax.naming);
>    importClass(Packages.com.mycompany.accounting.AccountHome);
>   var initialContext = new InitialContext();
>   var ejbHome =
> initialContext.*lookup*("*java:comp/env/com/mycompany/accounting/A
> ccountEJB*");
>   var accountHome =
> Packages.javax.rmi.PortableRemoteObject.narrow(ejbHome, AccountHome);
>
>
> JavaScript "JavaClass" objects like AccountHome in the above example are
> implicitly converted to the corresponding java.lang.Class object when
> passed as an argument to a Java method.
>
> Chris
>
> Ulf Sahlin wrote:
>
> >Hello!
> >
> >Can someone please post a working implementation of an EJB lookup from
> >within Woody's binding.js flowscript (i.e. the ugly Home lookup onto the
> >findByPrimaryKey stuff)? I'm having difficulties with the
> (javascript-style)
> >syntax and I cannot seem to find a good resource for reference nor good
> >examples. Currently I'm having issues with the myhome.class
> narrowing part.
> >I've tried with myhome["class"] to avoid the reserved keyword
> issue but I'm
> >still having problems. The error i get is:
> >
> >--- class "<myhome>" has no public instance field or method
> named "class".
> >
> >I guess I have some issues with package importing or something.
> It's working
> >great if I use the bean setters manually and load the form with
> that bean.
> >
> >
> > Cheers,
> >    Ulf Sahlin
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: woody, flowscript and ejb

Posted by Christopher Oliver <re...@verizon.net>.
Try something like this:

   importPackage(Packages.javax.naming);
   importClass(Packages.com.mycompany.accounting.AccountHome);
  var initialContext = new InitialContext();
  var ejbHome = 
initialContext.*lookup*("*java:comp/env/com/mycompany/accounting/AccountEJB*");
  var accountHome = 
Packages.javax.rmi.PortableRemoteObject.narrow(ejbHome, AccountHome);


JavaScript "JavaClass" objects like AccountHome in the above example are 
implicitly converted to the corresponding java.lang.Class object when 
passed as an argument to a Java method.

Chris
 
Ulf Sahlin wrote:

>Hello!
>
>Can someone please post a working implementation of an EJB lookup from
>within Woody's binding.js flowscript (i.e. the ugly Home lookup onto the
>findByPrimaryKey stuff)? I'm having difficulties with the (javascript-style)
>syntax and I cannot seem to find a good resource for reference nor good
>examples. Currently I'm having issues with the myhome.class narrowing part.
>I've tried with myhome["class"] to avoid the reserved keyword issue but I'm
>still having problems. The error i get is:
>
>--- class "<myhome>" has no public instance field or method named "class".
>
>I guess I have some issues with package importing or something. It's working
>great if I use the bean setters manually and load the form with that bean.
>
>
> Cheers,
>    Ulf Sahlin
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org