You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ashwanth Kumar <as...@gmail.com> on 2010/01/26 08:10:56 UTC
Help with Tapestry IoC
Hello,
I'm now, trying to do a desktop client for which i need some CRUD actions,
and since, being a user of Tapestry, i thought i could use Tapestry IoC
standalone for my app. Can anyone provide me some light on using Tapestry
IoC, on an offline app.
- Ashwanth Kumar
Re: Help with Tapestry IoC
Posted by Ashwanth Kumar <as...@gmail.com>.
Thanks Thiago,
I got it working. Thanks a lot!! :)
- Ashwanth Kumar
On Tue, Jan 26, 2010 at 4:00 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:
> On Tue, 26 Jan 2010 05:10:56 -0200, Ashwanth Kumar <
> ashwanth.kumar@gmail.com> wrote:
>
> Hello,
>>
>
> Hi!
>
>
> I'm now, trying to do a desktop client for which i need some CRUD actions,
>> and since, being a user of Tapestry, i thought i could use Tapestry IoC
>> standalone for my app. Can anyone provide me some light on using Tapestry
>> IoC, on an offline app.
>>
>
> Tapestry-IoC works exactly the same with or without Tapestry. In your case,
> you just need to start the Registry yourself. It's documented here:
> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/run.html. To load
> modules from the classpath and add them to your RegistryBuilder, just call
> IOCUtilities.addDefaultModules(builder);.
>
> Simple example:
>
>
> RegistryBuilder builder = new RegistryBuilder();
> builder.add(ModuleClass1.class, ModuleClass2.class);
> IOCUtilities.addDefaultModules(builder);
> final Registry registry = builder.build();
>
> SomeService service = registry.getService(SomeService.class);
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Help with Tapestry IoC
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 26 Jan 2010 09:43:59 -0200, Sven Homburg <ho...@googlemail.com>
wrote:
> remove the line
> IOCUtilities.addDefaultModules(builder);
I can't see why this line would cause any problems, as it just scans the
JARs in the classpath for manifest files containing a
Tapestry-Module-Classes line.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Help with Tapestry IoC
Posted by Sven Homburg <ho...@googlemail.com>.
remove the line
IOCUtilities.addDefaultModules(builder);
with regards
Sven Homburg
Founder of the Chenille Kit Project
http://chenillekit.codehaus.org
2010/1/26 Ashwanth Kumar <as...@gmail.com>
> This is my class:
>
> package reformists.util;
>
> import org.apache.tapestry5.ioc.IOCUtilities;
> import org.apache.tapestry5.ioc.Registry;
> import org.apache.tapestry5.ioc.RegistryBuilder;
>
> import reformists.services.BtmyModule;
>
> public class URegistry {
>
> private static final Registry registry;
> static {
> System.out.println("Im building the Registry!");
> RegistryBuilder builder = new RegistryBuilder();
> // builder.add(Session.class);
> builder.add(BtmyModule.class);
> IOCUtilities.addDefaultModules(builder);
> registry = builder.build();
> registry.performRegistryStartup();
> }
>
> public static Registry getRegistry() {
> return registry;
> }
>
> }
>
> Do u find any problems with that?
>
> - Ashwanth Kumar
>
> On Tue, Jan 26, 2010 at 5:01 PM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
> > On Tue, 26 Jan 2010 09:16:19 -0200, Ashwanth Kumar <
> > ashwanth.kumar@gmail.com> wrote:
> >
> > Thiago,
> >>
> >> I get the following error:
> >>
> >> 2010-01-26 16:43:11,453 ERROR [SerializationSupport] Setting a new
> service
> >> proxy provider when there's already an existing provider. This may
> >> indicate
> >> that you have multiple IoC Registries.
> >>
> >> I've only one instance of Registry running!!??
> >>
> >
> > I've never had that error message. Please post your code.
> >
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> > and instructor
> > Owner, software architect and developer, Ars Machina Tecnologia da
> > Informação Ltda.
> > http://www.arsmachina.com.br
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
Re: Help with Tapestry IoC
Posted by Howard Lewis Ship <hl...@gmail.com>.
I believe you do need to invoke performRegistryStartup(). This is how
EagerLoad services get loaded. TapestryFilter normally does this.
On Tue, Jan 26, 2010 at 4:08 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Tue, 26 Jan 2010 09:35:33 -0200, Ashwanth Kumar
> <as...@gmail.com> wrote:
>
>> registry.performRegistryStartup();
>
> AFAIK, you don't need to invoke this method yourself.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Help with Tapestry IoC
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 26 Jan 2010 09:35:33 -0200, Ashwanth Kumar
<as...@gmail.com> wrote:
> registry.performRegistryStartup();
AFAIK, you don't need to invoke this method yourself.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Help with Tapestry IoC
Posted by Ashwanth Kumar <as...@gmail.com>.
This is my class:
package reformists.util;
import org.apache.tapestry5.ioc.IOCUtilities;
import org.apache.tapestry5.ioc.Registry;
import org.apache.tapestry5.ioc.RegistryBuilder;
import reformists.services.BtmyModule;
public class URegistry {
private static final Registry registry;
static {
System.out.println("Im building the Registry!");
RegistryBuilder builder = new RegistryBuilder();
// builder.add(Session.class);
builder.add(BtmyModule.class);
IOCUtilities.addDefaultModules(builder);
registry = builder.build();
registry.performRegistryStartup();
}
public static Registry getRegistry() {
return registry;
}
}
Do u find any problems with that?
- Ashwanth Kumar
On Tue, Jan 26, 2010 at 5:01 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:
> On Tue, 26 Jan 2010 09:16:19 -0200, Ashwanth Kumar <
> ashwanth.kumar@gmail.com> wrote:
>
> Thiago,
>>
>> I get the following error:
>>
>> 2010-01-26 16:43:11,453 ERROR [SerializationSupport] Setting a new service
>> proxy provider when there's already an existing provider. This may
>> indicate
>> that you have multiple IoC Registries.
>>
>> I've only one instance of Registry running!!??
>>
>
> I've never had that error message. Please post your code.
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Help with Tapestry IoC
Posted by Ashwanth Kumar <as...@gmail.com>.
Actually,
I'm trying to build a frontend interface using Vaadin, (though i was using
tapestry, i just want to give it a try).. And I got used to accessing my
database, from hibernate and tapestry:
@Inject
private Session _session;
>From Tapestry, I just want the same, for this app too. Thats y, i wanted to
use Tapestry IoC, with Tapestry Hibernate package.
And i get that, ERROR Message, but Database access works fine for me.. I
just get that error message in console window..
- Ashwanth Kumar
On Tue, Jan 26, 2010 at 5:01 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:
> On Tue, 26 Jan 2010 09:16:19 -0200, Ashwanth Kumar <
> ashwanth.kumar@gmail.com> wrote:
>
> Thiago,
>>
>> I get the following error:
>>
>> 2010-01-26 16:43:11,453 ERROR [SerializationSupport] Setting a new service
>> proxy provider when there's already an existing provider. This may
>> indicate
>> that you have multiple IoC Registries.
>>
>> I've only one instance of Registry running!!??
>>
>
> I've never had that error message. Please post your code.
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Help with Tapestry IoC
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 26 Jan 2010 09:16:19 -0200, Ashwanth Kumar
<as...@gmail.com> wrote:
> Thiago,
>
> I get the following error:
>
> 2010-01-26 16:43:11,453 ERROR [SerializationSupport] Setting a new
> service
> proxy provider when there's already an existing provider. This may
> indicate
> that you have multiple IoC Registries.
>
> I've only one instance of Registry running!!??
I've never had that error message. Please post your code.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Help with Tapestry IoC
Posted by Ashwanth Kumar <as...@gmail.com>.
Thiago,
I get the following error:
2010-01-26 16:43:11,453 ERROR [SerializationSupport] Setting a new service
proxy provider when there's already an existing provider. This may indicate
that you have multiple IoC Registries.
I've only one instance of Registry running!!??
- Ashwanth Kumar
On Tue, Jan 26, 2010 at 4:00 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:
> On Tue, 26 Jan 2010 05:10:56 -0200, Ashwanth Kumar <
> ashwanth.kumar@gmail.com> wrote:
>
> Hello,
>>
>
> Hi!
>
>
> I'm now, trying to do a desktop client for which i need some CRUD actions,
>> and since, being a user of Tapestry, i thought i could use Tapestry IoC
>> standalone for my app. Can anyone provide me some light on using Tapestry
>> IoC, on an offline app.
>>
>
> Tapestry-IoC works exactly the same with or without Tapestry. In your case,
> you just need to start the Registry yourself. It's documented here:
> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/run.html. To load
> modules from the classpath and add them to your RegistryBuilder, just call
> IOCUtilities.addDefaultModules(builder);.
>
> Simple example:
>
>
> RegistryBuilder builder = new RegistryBuilder();
> builder.add(ModuleClass1.class, ModuleClass2.class);
> IOCUtilities.addDefaultModules(builder);
> final Registry registry = builder.build();
>
> SomeService service = registry.getService(SomeService.class);
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Help with Tapestry IoC
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 26 Jan 2010 05:10:56 -0200, Ashwanth Kumar
<as...@gmail.com> wrote:
> Hello,
Hi!
> I'm now, trying to do a desktop client for which i need some CRUD
> actions,
> and since, being a user of Tapestry, i thought i could use Tapestry IoC
> standalone for my app. Can anyone provide me some light on using Tapestry
> IoC, on an offline app.
Tapestry-IoC works exactly the same with or without Tapestry. In your
case, you just need to start the Registry yourself. It's documented here:
http://tapestry.apache.org/tapestry5.1/tapestry-ioc/run.html. To load
modules from the classpath and add them to your RegistryBuilder, just call
IOCUtilities.addDefaultModules(builder);.
Simple example:
RegistryBuilder builder = new RegistryBuilder();
builder.add(ModuleClass1.class, ModuleClass2.class);
IOCUtilities.addDefaultModules(builder);
final Registry registry = builder.build();
SomeService service = registry.getService(SomeService.class);
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org