RE: General HiveMind questions

2006-07-11 Thread Epstein, Ezra
Thank you.  I found out that HiveMind was indeed throwing an exception and it 
was being logged ... I'd missed it.  And, when I googled the exception string I 
found the same solution.  I was going to post the answer but thanks to your 
quick response, I don't need to.

Ezra Epstein 


-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 1:37 PM
To: Tapestry users
Subject: Re: General HiveMind questions

No...I think it's .. So, if you hivemodule.xml file has 
CustomTeamPageAdmin as the id and a service id of "jndiLookup" you would 
reference the service as "CustomTeamPageAdmin.jndiLookup" .

The things you see in svn rely on package="" being set on the  element, 
it's a convenience to eliminate verbose package strings when constructing 
services..

For JNDI, I think the Virtual Library application has an example of that. It 
even uses jboss so you should feel right at home.

http://tapestry.apache.org/tapestry4.1/exampleapps/index.html
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Vlib/src/context/WEB-INF/hivemodule.xml?view=markup

You almost sound like you've been "forced" to use Tapestry. Ah well.

On 7/11/06, Epstein, Ezra <[EMAIL PROTECTED]> wrote:
>
> OK, thanks to the SVN links, I see I need to reference the service by 
> the Java class of the interface, not by the id which I assigned to 
> that service).  Very curious and I either missed that in the docs or 
> (once
> again?) it's not documented.
>
> I swear, back in Tap2.0 I was an evangelist, but at this point using 
> Tapestry feels like coding by braille or utter trial and error.  Is 
> that just me or is there some hard to find great docs that everyone 
> else has read?  If so, please, please pass along the link.
>
> Thanks,
>
> Ezra Epstein
>
>
> -Original Message-
> From: Epstein, Ezra [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 11, 2006 1:19 PM
> To: Tapestry users
> Subject: RE: General HiveMind questions
>
> Thanks.  I'm not (yet) using autowire (nor Tap4.1) so how does one 
> reference something in a page?  I'm trying to use an annotation but 
> it's not working.  Here are some details:
>
> 
> Monday
>
> jndi
> info 
>
> 
> import java.util.Date;
>
> import org.apache.hivemind.lib.NameLookup;
> import org.apache.tapestry.annotations.InjectObject;
> import org.apache.tapestry.html.BasePage;
>
> public abstract class View extends BasePage {
>
> @InjectObject("service:jndiLookup")
> public abstract NameLookup getJndiLookupService();
>
> // This blows chunks.
> public String getJndiServiceString() {
> return getJndiLookupService().toString();
> }
>
> // This works
> public String getDate() {
> return (new Date()).toString();
> }
>
> }
> 
>
> 
> 
> 
>
>  interface="org.apache.hivemind.lib.NameLookup"
> parameters-occurs="none">
>
>  model="singleton">
>
> 
>  value="
> org.jnp.interfaces.NamingContextFactory" />
>  value="
> org.jboss.naming:org.jnp.interfaces" />
>  value="jnp://localhost:1099" />
>  
> service-id="RemoteExceptionCoordinator"
> />
>  service-id="RemoteExceptionCoordinator" />
> 
>
> 
> 
> 
> 
>
>
> The hivemodule.xml is in the WEB-INF folder and is being found and 
> parsed (I know, because I initially left out the version attribute and 
> saw an exception in the JBoss logs).
>
> The above doesn't work.  Am I referencing the hivemind stuff the wrong 
> way? using the annotation incorrectly?  HiveMind is completely silent 
> on the subject (nothing in the JBoss logs or the page) what I see is:
>
> 
> org.apache.tapestry.BindingException
> Unable to read OGNL expression '' of
> [EMAIL PROTECTED]: jndiServiceString
> binding ExpressionBinding[View jndiServiceString]
> locationcontext:/View.html, line 11
> 6
> 7   
> 8   
> 9   
> 10
> 11  jndi
> info
> 12
> 13  
> 14  
> org.apache.hivemind.ApplicationRunti

Re: General HiveMind questions

2006-07-11 Thread Jesse Kuhnert

No...I think it's .. So, if you hivemodule.xml file
has CustomTeamPageAdmin as the id and a service id of "jndiLookup" you would
reference the service as "CustomTeamPageAdmin.jndiLookup" .

The things you see in svn rely on package="" being set on the 
element, it's a convenience to eliminate verbose package strings when
constructing services..

For JNDI, I think the Virtual Library application has an example of that. It
even uses jboss so you should feel right at home.

http://tapestry.apache.org/tapestry4.1/exampleapps/index.html
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Vlib/src/context/WEB-INF/hivemodule.xml?view=markup

You almost sound like you've been "forced" to use Tapestry. Ah well.

On 7/11/06, Epstein, Ezra <[EMAIL PROTECTED]> wrote:


OK, thanks to the SVN links, I see I need to reference the service by the
Java class of the interface, not by the id which I assigned to that
service).  Very curious and I either missed that in the docs or (once
again?) it's not documented.

I swear, back in Tap2.0 I was an evangelist, but at this point using
Tapestry feels like coding by braille or utter trial and error.  Is that
just me or is there some hard to find great docs that everyone else has
read?  If so, please, please pass along the link.

Thanks,

Ezra Epstein


-Original Message-
From: Epstein, Ezra [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 11, 2006 1:19 PM
To: Tapestry users
Subject: RE: General HiveMind questions

Thanks.  I'm not (yet) using autowire (nor Tap4.1) so how does one
reference something in a page?  I'm trying to use an annotation but it's not
working.  Here are some details:


Monday

jndi
info 


import java.util.Date;

import org.apache.hivemind.lib.NameLookup;
import org.apache.tapestry.annotations.InjectObject;
import org.apache.tapestry.html.BasePage;

public abstract class View extends BasePage {

@InjectObject("service:jndiLookup")
public abstract NameLookup getJndiLookupService();

// This blows chunks.
public String getJndiServiceString() {
return getJndiLookupService().toString();
}

// This works
public String getDate() {
return (new Date()).toString();
}

}
























The hivemodule.xml is in the WEB-INF folder and is being found and parsed
(I know, because I initially left out the version attribute and saw an
exception in the JBoss logs).

The above doesn't work.  Am I referencing the hivemind stuff the wrong
way? using the annotation incorrectly?  HiveMind is completely silent on the
subject (nothing in the JBoss logs or the page) what I see is:


org.apache.tapestry.BindingException
Unable to read OGNL expression '' of
[EMAIL PROTECTED]: jndiServiceString
binding ExpressionBinding[View jndiServiceString]
locationcontext:/View.html, line 11
6
7   
8   
9   
10
11  jndi
info
12
13  
14  
org.apache.hivemind.ApplicationRuntimeException
Unable to read OGNL expression '' of
[EMAIL PROTECTED]: jndiServiceString
component   [EMAIL PROTECTED]
locationcontext:/View.html
ognl.OgnlException
jndiServiceString
java.lang.AbstractMethodError
amazon.pizza.portal.tapestry.pages.View.getJndiLookupService
()Lorg/apache/hivemind/lib/NameLookup;

* amazon.pizza.portal.tapestry.pages.View.getJndiServiceString(
View.java:21)
* sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
* sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
* sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
* java.lang.reflect.Method.invoke(Method.java:585)
* ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)


Which, thanks to the vaunted "line-precise error reporting," tells me
exactly what I already knew and very little about what's causing the
issue.  Hence this post Any help appreciated.

BTW, I can't for the best Google query I can construct, find a simple
example of accessing a JNDI object via HiveMind and using it in Tapestry
page or component.  I'd think this would be a canonical example.  I find
plenty with Spring, of course, ...

Ezra Epstein


-----Original Message-
From: James Carman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 11, 2006 12:17 PM
To: 'Tapestry users'
Subject: RE: General HiveMind questions

Well, HiveMind does support "bean" services, but they're not recommended
really (at least not by me).  Interface-based services are preferred.
Anyway, if you have to use a bean, all y

RE: General HiveMind questions

2006-07-11 Thread Epstein, Ezra
OK, thanks to the SVN links, I see I need to reference the service by the Java 
class of the interface, not by the id which I assigned to that service).  Very 
curious and I either missed that in the docs or (once again?) it's not 
documented.

I swear, back in Tap2.0 I was an evangelist, but at this point using Tapestry 
feels like coding by braille or utter trial and error.  Is that just me or is 
there some hard to find great docs that everyone else has read?  If so, please, 
please pass along the link. 

Thanks, 

Ezra Epstein 


-Original Message-
From: Epstein, Ezra [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 1:19 PM
To: Tapestry users
Subject: RE: General HiveMind questions

Thanks.  I'm not (yet) using autowire (nor Tap4.1) so how does one reference 
something in a page?  I'm trying to use an annotation but it's not working.  
Here are some details:


Monday

jndi info 



import java.util.Date;

import org.apache.hivemind.lib.NameLookup;
import org.apache.tapestry.annotations.InjectObject;
import org.apache.tapestry.html.BasePage;

public abstract class View extends BasePage {

@InjectObject("service:jndiLookup")
public abstract NameLookup getJndiLookupService();

// This blows chunks.
public String getJndiServiceString() {
return getJndiLookupService().toString();
}

// This works
public String getDate() {
return (new Date()).toString();
}

}
























The hivemodule.xml is in the WEB-INF folder and is being found and parsed (I 
know, because I initially left out the version attribute and saw an exception 
in the JBoss logs).

The above doesn't work.  Am I referencing the hivemind stuff the wrong way? 
using the annotation incorrectly?  HiveMind is completely silent on the subject 
(nothing in the JBoss logs or the page) what I see is:


org.apache.tapestry.BindingException
Unable to read OGNL expression '' of [EMAIL PROTECTED]: 
jndiServiceString
binding ExpressionBinding[View jndiServiceString]
locationcontext:/View.html, line 11
6   
7   
8   
9   
10  
11  jndi 
info
12  
13  
14  
org.apache.hivemind.ApplicationRuntimeException
Unable to read OGNL expression '' of [EMAIL PROTECTED]: 
jndiServiceString
component   [EMAIL PROTECTED]
locationcontext:/View.html
ognl.OgnlException
jndiServiceString
java.lang.AbstractMethodError
amazon.pizza.portal.tapestry.pages.View.getJndiLookupService()Lorg/apache/hivemind/lib/NameLookup;

* amazon.pizza.portal.tapestry.pages.View.getJndiServiceString(View.java:21)
* sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
* 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
* 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
* java.lang.reflect.Method.invoke(Method.java:585)
* ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)


Which, thanks to the vaunted "line-precise error reporting," tells me exactly 
what I already knew and very little about what's causing the issue.  Hence this 
post Any help appreciated.

BTW, I can't for the best Google query I can construct, find a simple example 
of accessing a JNDI object via HiveMind and using it in Tapestry page or 
component.  I'd think this would be a canonical example.  I find plenty with 
Spring, of course, ...

Ezra Epstein 


-Original Message-
From: James Carman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 11, 2006 12:17 PM
To: 'Tapestry users'
Subject: RE: General HiveMind questions

Well, HiveMind does support "bean" services, but they're not recommended really 
(at least not by me).  Interface-based services are preferred.
Anyway, if you have to use a bean, all you have to do is use the bean class as 
the interface when defining your service.  You can set your "parameters"
by autowiring (if they're supposed to be references to other HiveMind
services) or using XML inside the hivemodule.xml file.  If you're using 
tapestry-autowire (or Tap4.1), then all you have to do is declare an abstract 
getter of the same type as your bean class and Tapestry will automatically look 
it up for you.

-Original Message-
From: Epstein, Ezra [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 11, 2006 3:12 PM
To: Tapestry users
Subject: General HiveMind questions

So I've got an object I want to make available to a Tapestry page and I want to 
use HiveMind to do this.  What are the steps one takes?

More specifically: t

RE: General HiveMind questions

2006-07-11 Thread Epstein, Ezra
Thanks.  I'm not (yet) using autowire (nor Tap4.1) so how does one reference 
something in a page?  I'm trying to use an annotation but it's not working.  
Here are some details:


Monday

jndi info



import java.util.Date;

import org.apache.hivemind.lib.NameLookup;
import org.apache.tapestry.annotations.InjectObject;
import org.apache.tapestry.html.BasePage;

public abstract class View extends BasePage {

@InjectObject("service:jndiLookup")
public abstract NameLookup getJndiLookupService();

// This blows chunks.
public String getJndiServiceString() {
return getJndiLookupService().toString();
}

// This works
public String getDate() {
return (new Date()).toString();
}

}
























The hivemodule.xml is in the WEB-INF folder and is being found and parsed (I 
know, because I initially left out the version attribute and saw an exception 
in the JBoss logs).

The above doesn't work.  Am I referencing the hivemind stuff the wrong way? 
using the annotation incorrectly?  HiveMind is completely silent on the subject 
(nothing in the JBoss logs or the page) what I see is:


org.apache.tapestry.BindingException
Unable to read OGNL expression '' of [EMAIL PROTECTED]: 
jndiServiceString
binding ExpressionBinding[View jndiServiceString]
locationcontext:/View.html, line 11
6   
7   
8   
9   
10  
11  jndi 
info
12  
13  
14  
org.apache.hivemind.ApplicationRuntimeException
Unable to read OGNL expression '' of [EMAIL PROTECTED]: 
jndiServiceString
component   [EMAIL PROTECTED]
locationcontext:/View.html
ognl.OgnlException
jndiServiceString
java.lang.AbstractMethodError
amazon.pizza.portal.tapestry.pages.View.getJndiLookupService()Lorg/apache/hivemind/lib/NameLookup;

* amazon.pizza.portal.tapestry.pages.View.getJndiServiceString(View.java:21)
* sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
* 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
* 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
* java.lang.reflect.Method.invoke(Method.java:585)
* ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)


Which, thanks to the vaunted "line-precise error reporting," tells me exactly 
what I already knew and very little about what's causing the issue.  Hence this 
post Any help appreciated.

BTW, I can't for the best Google query I can construct, find a simple example 
of accessing a JNDI object via HiveMind and using it in Tapestry page or 
component.  I'd think this would be a canonical example.  I find plenty with 
Spring, of course, ...

Ezra Epstein 


-Original Message-
From: James Carman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 12:17 PM
To: 'Tapestry users'
Subject: RE: General HiveMind questions

Well, HiveMind does support "bean" services, but they're not recommended really 
(at least not by me).  Interface-based services are preferred.
Anyway, if you have to use a bean, all you have to do is use the bean class as 
the interface when defining your service.  You can set your "parameters"
by autowiring (if they're supposed to be references to other HiveMind
services) or using XML inside the hivemodule.xml file.  If you're using 
tapestry-autowire (or Tap4.1), then all you have to do is declare an abstract 
getter of the same type as your bean class and Tapestry will automatically look 
it up for you.

-Original Message-
From: Epstein, Ezra [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 11, 2006 3:12 PM
To: Tapestry users
Subject: General HiveMind questions

So I've got an object I want to make available to a Tapestry page and I want to 
use HiveMind to do this.  What are the steps one takes?

More specifically: the object does *not* implement an interface; the object has 
parameters (set via mutator methods).

(Maybe should be posted on the HiveMind lists) 

Thanks, 

Ezra Epstein 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: General HiveMind questions

2006-07-11 Thread James Carman
Well, HiveMind does support "bean" services, but they're not recommended
really (at least not by me).  Interface-based services are preferred.
Anyway, if you have to use a bean, all you have to do is use the bean class
as the interface when defining your service.  You can set your "parameters"
by autowiring (if they're supposed to be references to other HiveMind
services) or using XML inside the hivemodule.xml file.  If you're using
tapestry-autowire (or Tap4.1), then all you have to do is declare an
abstract getter of the same type as your bean class and Tapestry will
automatically look it up for you.

-Original Message-
From: Epstein, Ezra [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 3:12 PM
To: Tapestry users
Subject: General HiveMind questions

So I've got an object I want to make available to a Tapestry page and I want
to use HiveMind to do this.  What are the steps one takes?

More specifically: the object does *not* implement an interface; the object
has parameters (set via mutator methods).

(Maybe should be posted on the HiveMind lists) 

Thanks, 

Ezra Epstein 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: General HiveMind questions

2006-07-11 Thread Jesse Kuhnert

I usually like to look at working examples when starting out on something
like this. I don't think this one will necessarily be the best example but
you can view all of it online :

http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/hivemodule.xml?view=markup

That link goes to a sample hivemodule.xml file, but you'll want to navigate
around and view the sub-modules that that particular hivemodule.xml file
references. (didn't want to give you a link to them directly without knowing
how they were connected..)

On 7/11/06, Epstein, Ezra <[EMAIL PROTECTED]> wrote:


So I've got an object I want to make available to a Tapestry page and I
want to use HiveMind to do this.  What are the steps one takes?

More specifically: the object does *not* implement an interface; the
object has parameters (set via mutator methods).

(Maybe should be posted on the HiveMind lists)

Thanks,

Ezra Epstein

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.