How to use the third-party T5 Component in another T5 project

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use the third-party T5 Component in another T5 project

蝈蝈龙
Hi All,

I use T5.0.4. I packaged some common components to common.jar.
You know, in T3/4, we may add a configuration like contrib to
.application file. But how can I use it in my another project base on T5?


Thanks
Allen Guo


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to use the third-party T5 Component in another T5 project

蝈蝈龙
Nobody answer me ? :(

> Hi All,
>
> I use T5.0.4. I packaged some common components to common.jar.
> You know, in T3/4, we may add a configuration like contrib to
> .application file. But how can I use it in my another project base on T5?
>
>
> Thanks
> Allen Guo
>
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to use the third-party T5 Component in another T5 project

Kristian Marinkovic
i think you have to deploy the jar (make it available in the classpath)
and add the new package path to the tapestry.app-package
parameter in web.xml

g
kris




Allen Guo <[hidden email]>
08.06.2007 12:47
Bitte antworten an
"Tapestry users" <[hidden email]>


An
Tapestry users <[hidden email]>
Kopie

Thema
Re: How to use the third-party T5 Component in another T5 project






Nobody answer me ? :(
> Hi All,
>
> I use T5.0.4. I packaged some common components to common.jar.
> You know, in T3/4, we may add a configuration like contrib to
> .application file. But how can I use it in my another project base on
T5?
>
>
> Thanks
> Allen Guo
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: How to use the third-party T5 Component in another T5 project

蝈蝈龙
But I can only a tapestry.app-package in web.xml
And another question is ,
if the component have the same name with the component in my project, what
should I do?

2007/6/8, Kristian Marinkovic <[hidden email]>:

>
> i think you have to deploy the jar (make it available in the classpath)
> and add the new package path to the tapestry.app-package
> parameter in web.xml
>
> g
> kris
>
>
>
>
> Allen Guo <[hidden email]>
> 08.06.2007 12:47
> Bitte antworten an
> "Tapestry users" <[hidden email]>
>
>
> An
> Tapestry users <[hidden email]>
> Kopie
>
> Thema
> Re: How to use the third-party T5 Component in another T5 project
>
>
>
>
>
>
> Nobody answer me ? :(
> > Hi All,
> >
> > I use T5.0.4. I packaged some common components to common.jar.
> > You know, in T3/4, we may add a configuration like contrib to
> > .application file. But how can I use it in my another project base on
> T5?
> >
> >
> > Thanks
> > Allen Guo
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: How to use the third-party T5 Component in another T5 project

Kristian Marinkovic
just forget what i said before....

you can use a LibraryMapping to add other component libraries.
therefore you have to contribute your library (that contains a prefix
and the root package) to a tapestry ioc service:

in you AppModule class

public static void
contributeComponentClassResolver(Configuration<LibraryMapping>
configuration)
    {
        configuration.add(new LibraryMapping("whatever",
"org.whatever.mycomponents"));
    }

g
kris




"蝈蝈龙" <[hidden email]>
08.06.2007 13:31
Bitte antworten an
"Tapestry users" <[hidden email]>


An
"Tapestry users" <[hidden email]>
Kopie

Thema
Re: How to use the third-party T5 Component in another T5 project






But I can only a tapestry.app-package in web.xml
And another question is ,
if the component have the same name with the component in my project, what
should I do?

2007/6/8, Kristian Marinkovic <[hidden email]>:

>
> i think you have to deploy the jar (make it available in the classpath)
> and add the new package path to the tapestry.app-package
> parameter in web.xml
>
> g
> kris
>
>
>
>
> Allen Guo <[hidden email]>
> 08.06.2007 12:47
> Bitte antworten an
> "Tapestry users" <[hidden email]>
>
>
> An
> Tapestry users <[hidden email]>
> Kopie
>
> Thema
> Re: How to use the third-party T5 Component in another T5 project
>
>
>
>
>
>
> Nobody answer me ? :(
> > Hi All,
> >
> > I use T5.0.4. I packaged some common components to common.jar.
> > You know, in T3/4, we may add a configuration like contrib to
> > .application file. But how can I use it in my another project base on
> T5?
> >
> >
> > Thanks
> > Allen Guo
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: How to use the third-party T5 Component in another T5 project

蝈蝈龙
I added the code to AppModule.class
   onfiguration.add(new LibraryMapping("opend","org.opend.corelib"));
Then refer to the component in html template like this
  <span t:type="opend:Radio" />
Am I right? It always throw the exception below

Unable to resolve component type 'opend:Radio' to a component class name.
Available component types: FlatImg, Layout, core/ActionLink, core/Any,
core/BeanEditForm, core/Checkbo........................

2007/6/8, Kristian Marinkovic <[hidden email]>:

>
> just forget what i said before....
>
> you can use a LibraryMapping to add other component libraries.
> therefore you have to contribute your library (that contains a prefix
> and the root package) to a tapestry ioc service:
>
> in you AppModule class
>
> public static void
> contributeComponentClassResolver(Configuration<LibraryMapping>
> configuration)
>     {
>         configuration.add(new LibraryMapping("whatever",
> "org.whatever.mycomponents"));
>     }
>
> g
> kris
>
>
>
>
> "蝈蝈龙" <[hidden email]>
> 08.06.2007 13:31
> Bitte antworten an
> "Tapestry users" <[hidden email]>
>
>
> An
> "Tapestry users" <[hidden email]>
> Kopie
>
> Thema
> Re: How to use the third-party T5 Component in another T5 project
>
>
>
>
>
>
> But I can only a tapestry.app-package in web.xml
> And another question is ,
> if the component have the same name with the component in my project, what
> should I do?
>
> 2007/6/8, Kristian Marinkovic <[hidden email]>:
> >
> > i think you have to deploy the jar (make it available in the classpath)
> > and add the new package path to the tapestry.app-package
> > parameter in web.xml
> >
> > g
> > kris
> >
> >
> >
> >
> > Allen Guo <[hidden email]>
> > 08.06.2007 12:47
> > Bitte antworten an
> > "Tapestry users" <[hidden email]>
> >
> >
> > An
> > Tapestry users <[hidden email]>
> > Kopie
> >
> > Thema
> > Re: How to use the third-party T5 Component in another T5 project
> >
> >
> >
> >
> >
> >
> > Nobody answer me ? :(
> > > Hi All,
> > >
> > > I use T5.0.4. I packaged some common components to common.jar.
> > > You know, in T3/4, we may add a configuration like contrib to
> > > .application file. But how can I use it in my another project base on
> > T5?
> > >
> > >
> > > Thanks
> > > Allen Guo
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: How to use the third-party T5 Component in another T5 project

Kristian Marinkovic
try "opend/Radio" ... :)



"蝈蝈龙" <[hidden email]>
08.06.2007 13:56
Bitte antworten an
"Tapestry users" <[hidden email]>


An
"Tapestry users" <[hidden email]>
Kopie

Thema
Re: How to use the third-party T5 Component in another T5 project






I added the code to AppModule.class
   onfiguration.add(new LibraryMapping("opend","org.opend.corelib"));
Then refer to the component in html template like this
  <span t:type="opend:Radio" />
Am I right? It always throw the exception below

Unable to resolve component type 'opend:Radio' to a component class name.
Available component types: FlatImg, Layout, core/ActionLink, core/Any,
core/BeanEditForm, core/Checkbo........................

2007/6/8, Kristian Marinkovic <[hidden email]>:

>
> just forget what i said before....
>
> you can use a LibraryMapping to add other component libraries.
> therefore you have to contribute your library (that contains a prefix
> and the root package) to a tapestry ioc service:
>
> in you AppModule class
>
> public static void
> contributeComponentClassResolver(Configuration<LibraryMapping>
> configuration)
>     {
>         configuration.add(new LibraryMapping("whatever",
> "org.whatever.mycomponents"));
>     }
>
> g
> kris
>
>
>
>
> "蝈蝈龙" <[hidden email]>
> 08.06.2007 13:31
> Bitte antworten an
> "Tapestry users" <[hidden email]>
>
>
> An
> "Tapestry users" <[hidden email]>
> Kopie
>
> Thema
> Re: How to use the third-party T5 Component in another T5 project
>
>
>
>
>
>
> But I can only a tapestry.app-package in web.xml
> And another question is ,
> if the component have the same name with the component in my project,
what
> should I do?
>
> 2007/6/8, Kristian Marinkovic <[hidden email]>:
> >
> > i think you have to deploy the jar (make it available in the
classpath)

> > and add the new package path to the tapestry.app-package
> > parameter in web.xml
> >
> > g
> > kris
> >
> >
> >
> >
> > Allen Guo <[hidden email]>
> > 08.06.2007 12:47
> > Bitte antworten an
> > "Tapestry users" <[hidden email]>
> >
> >
> > An
> > Tapestry users <[hidden email]>
> > Kopie
> >
> > Thema
> > Re: How to use the third-party T5 Component in another T5 project
> >
> >
> >
> >
> >
> >
> > Nobody answer me ? :(
> > > Hi All,
> > >
> > > I use T5.0.4. I packaged some common components to common.jar.
> > > You know, in T3/4, we may add a configuration like contrib to
> > > .application file. But how can I use it in my another project base
on

> > T5?
> > >
> > >
> > > Thanks
> > > Allen Guo
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: How to use the third-party T5 Component in another T5 project

蝈蝈龙
I did it on your suggestion. It's working now :)
Thank you

2007/6/8, Kristian Marinkovic <[hidden email]>:

>
> try "opend/Radio" ... :)
>
>
>
> "蝈蝈龙" <[hidden email]>
> 08.06.2007 13:56
> Bitte antworten an
> "Tapestry users" < [hidden email]>
>
>
> An
> "Tapestry users" <[hidden email]>
> Kopie
>
> Thema
> Re: How to use the third-party T5 Component in another T5 project
>
>
>
>
>
>
> I added the code to AppModule.class
>    onfiguration.add(new LibraryMapping("opend","org.opend.corelib"));
> Then refer to the component in html template like this
>   <span t:type="opend:Radio" />
> Am I right? It always throw the exception below
>
> Unable to resolve component type 'opend:Radio' to a component class name.
> Available component types: FlatImg, Layout, core/ActionLink, core/Any,
> core/BeanEditForm, core/Checkbo........................
>
> 2007/6/8, Kristian Marinkovic <[hidden email]>:
> >
> > just forget what i said before....
> >
> > you can use a LibraryMapping to add other component libraries.
> > therefore you have to contribute your library (that contains a prefix
> > and the root package) to a tapestry ioc service:
> >
> > in you AppModule class
> >
> > public static void
> > contributeComponentClassResolver(Configuration<LibraryMapping>
> > configuration)
> >     {
> >         configuration.add(new LibraryMapping("whatever",
> > "org.whatever.mycomponents"));
> >     }
> >
> > g
> > kris
> >
> >
> >
> >
> > "蝈蝈龙" <[hidden email]>
> > 08.06.2007 13:31
> > Bitte antworten an
> > "Tapestry users" < [hidden email]>
> >
> >
> > An
> > "Tapestry users" <[hidden email]>
> > Kopie
> >
> > Thema
> > Re: How to use the third-party T5 Component in another T5 project
> >
> >
> >
> >
> >
> >
> > But I can only a tapestry.app-package in web.xml
> > And another question is ,
> > if the component have the same name with the component in my project,
> what
> > should I do?
> >
> > 2007/6/8, Kristian Marinkovic <[hidden email]>:
> > >
> > > i think you have to deploy the jar (make it available in the
> classpath)
> > > and add the new package path to the tapestry.app-package
> > > parameter in web.xml
> > >
> > > g
> > > kris
> > >
> > >
> > >
> > >
> > > Allen Guo < [hidden email]>
> > > 08.06.2007 12:47
> > > Bitte antworten an
> > > "Tapestry users" <[hidden email] >
> > >
> > >
> > > An
> > > Tapestry users <[hidden email]>
> > > Kopie
> > >
> > > Thema
> > > Re: How to use the third-party T5 Component in another T5 project
> > >
> > >
> > >
> > >
> > >
> > >
> > > Nobody answer me ? :(
> > > > Hi All,
> > > >
> > > > I use T5.0.4. I packaged some common components to common.jar.
> > > > You know, in T3/4, we may add a configuration like contrib to
> > > > .application file. But how can I use it in my another project base
> on
> > > T5?
> > > >
> > > >
> > > > Thanks
> > > > Allen Guo
> > > >
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> > >
> >
> >
> >
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: How to use the third-party T5 Component in another T5 project

Thiago H de Paula Figueiredo
In reply to this post by 蝈蝈龙
On Fri, 08 Jun 2007 07:47:21 -0300, Allen Guo <[hidden email]> wrote:

> Nobody answer me ? :(
>> Hi All,
>>
>> I use T5.0.4. I packaged some common components to common.jar.
>> You know, in T3/4, we may add a configuration like contrib to
>> .application file. But how can I use it in my another project base on  
>> T5?

All you need to do is to put your library/package in the application  
classpath.
Tapestry-IoC searches the classpath trying to find JARs that have a  
Tapestry-Module-Classes antry in its manifest file and autoloads the  
module classes specified there. This is just wonderful. :)
Take a look at  
http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html and search  
"Autoloading" for more details.

Thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[T5] StackMapTable format error: bad class index

Siddhartha Argollo
Hi all,

First of all: I'm using the 5.0.5 snapshot with JBoss 4.0.5-GA.
I have a component named LoginView. It shows the login status of the user.
The thing is, if I implement the beginRender method in this way:

@Inject
private SecurityService security;

void beginRender(MarkupWriter writer)
{
if( this.security.getAuthentication().isAuthenticated() )
{ ...
writer.write(this.security.getAuthentication().getUserName());
....
}
else ...
}

The application works fine. But, if I change the code to this:

@Inject
private SecurityService security;

void beginRender(MarkupWriter writer)
{
Authentication auth = this.security.getAuthentication();
if( auth.isAuthenticated() )
{ ...
writer.write(auth.getAuthentication().getUserName());
....
}
else ...
}

I receive the following exception:

An unexpected application exception has occurred.
...
* java.lang.ClassFormatError
StackMapTable format error: bad class index
...
Stack trace
o java.lang.Class.getDeclaredConstructors0(Native Method)
o java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
o java.lang.Class.getConstructors(Unknown Source)
o
org.apache.tapestry.internal.services.ReflectiveInstantiator.findConstructor(ReflectiveInstantiator.java:65)
o
org.apache.tapestry.internal.services.ReflectiveInstantiator.<init>(ReflectiveInstantiator.java:53)
....

I just want to know if this is a bug, or if I´m missing something, or if
I´m going crazy!
Thanks.

Sid.



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [T5] StackMapTable format error: bad class index

Howard Lewis Ship
That's an odd one!

You've done the normal ... clean rebuild, fresh restart, etc?

Are you using any inner classes in your page/component?  I recently
fixed a bug (in 5.0.5) related to those.

If you can use 5.0.5 please do ... it produces much more comprehensive
exception data when an error occurs related to runtime bytecode
enhancement.

On 6/8/07, Siddhartha Argollo <[hidden email]> wrote:

> Hi all,
>
> First of all: I'm using the 5.0.5 snapshot with JBoss 4.0.5-GA.
> I have a component named LoginView. It shows the login status of the user.
> The thing is, if I implement the beginRender method in this way:
>
> @Inject
> private SecurityService security;
>
> void beginRender(MarkupWriter writer)
> {
> if( this.security.getAuthentication().isAuthenticated() )
> { ...
> writer.write(this.security.getAuthentication().getUserName());
> ....
> }
> else ...
> }
>
> The application works fine. But, if I change the code to this:
>
> @Inject
> private SecurityService security;
>
> void beginRender(MarkupWriter writer)
> {
> Authentication auth = this.security.getAuthentication();
> if( auth.isAuthenticated() )
> { ...
> writer.write(auth.getAuthentication().getUserName());
> ....
> }
> else ...
> }
>
> I receive the following exception:
>
> An unexpected application exception has occurred.
> ...
> * java.lang.ClassFormatError
> StackMapTable format error: bad class index
> ...
> Stack trace
> o java.lang.Class.getDeclaredConstructors0(Native Method)
> o java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
> o java.lang.Class.getConstructors(Unknown Source)
> o
> org.apache.tapestry.internal.services.ReflectiveInstantiator.findConstructor(ReflectiveInstantiator.java:65)
> o
> org.apache.tapestry.internal.services.ReflectiveInstantiator.<init>(ReflectiveInstantiator.java:53)
> ....
>
> I just want to know if this is a bug, or if I´m missing something, or if
> I´m going crazy!
> Thanks.
>
> Sid.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]