[Resin-interest] How Resin/Ioc used for struts2/xwork2, need an ObjectFactory implementation

2007-12-21 Thread wesley
I'm using Struts2 in nearly every new projects these days, with Guice as the 
IoC injector.
I want to switch to Resin's WebBeans implementation and Resin/IoC.
One of the main concerns is that I could not figure out how to write a 
ObjectFactory implementation using
Resin/IoC/WebBeans infrastucture, like Guice/Spring did.

Could anyone provide me an example or some instructions/tips for me to 
follow?
Thanks very much.

Wesley

- Original Message - 
From: Jason Chodakowski [EMAIL PROTECTED]
To: General Discussion for the Resin application server 
resin-interest@caucho.com
Sent: Thursday, December 20, 2007 11:53 PM
Subject: [Resin-interest] 3.1.4 and Mac OS 10.5


 I'm not a configuration script wizard, but it appears the mechanism
 used in the resin configure script is not properly detecting the
 x86_64 platform on the mac including missing 64 bit java which is
 available in 10.5. I've tried a number of Apple recommended command
 line options to force as much as possible with still little to no
 success.

 Ideally, I need a 64 bit mod_caucho module which still eludes me.

 Anyone have any experience with this?

 Thanks,

 J --


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
 



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] How Resin/Ioc used for struts2/xwork2, need an ObjectFactory implementation

2007-12-21 Thread wesley
To implement a com.opensymphony.xwork2.ObjectFactory, we should override 
method
public Object buildBean(Class clazz, Map extraContext);
and create/obtain a bean instance of specified bean class (provided by param 
clazz).

I think I may get a WebBeansContainer instance as follow
WebBeansContainer container = WebBeansContainer.create();
and then use it to create/obtain bean instance.

How could I do this?

- Original Message - 
From: wesley [EMAIL PROTECTED]
To: General Discussion for the Resin application server 
resin-interest@caucho.com
Sent: Friday, December 21, 2007 8:06 PM
Subject: [Resin-interest] How Resin/Ioc used for struts2/xwork2,need an 
ObjectFactory implementation


 I'm using Struts2 in nearly every new projects these days, with Guice as 
 the
 IoC injector.
 I want to switch to Resin's WebBeans implementation and Resin/IoC.
 One of the main concerns is that I could not figure out how to write a
 ObjectFactory implementation using
 Resin/IoC/WebBeans infrastucture, like Guice/Spring did.

 Could anyone provide me an example or some instructions/tips for me to
 follow?
 Thanks very much.

 Wesley



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] How Resin/Ioc used for struts2/xwork2, need an ObjectFactory implementation

2007-12-21 Thread Scott Ferguson

On Dec 21, 2007, at 7:15 AM, wesley wrote:

 To implement a com.opensymphony.xwork2.ObjectFactory, we should  
 override
 method
 public Object buildBean(Class clazz, Map extraContext);
 and create/obtain a bean instance of specified bean class (provided  
 by param
 clazz).

 I think I may get a WebBeansContainer instance as follow
 WebBeansContainer container = WebBeansContainer.create();
 and then use it to create/obtain bean instance.

You can treat it as:

javax.webbeans.Container container = WebBeansContainer.create();

Then use

javax.webbeans.ComponentFactory component = container.resolveByType 
(clazz);

And then

   return component.get();

(or component.create(); if you want to force a creation)

The API piece of the webbeans draft spec/implementation is sketchy by  
the way.  So it's very likely the specifics will change in the next  
version of Resin.  In other words, it's fine as a temporary bridge  
for things like structs2/xwork2.

For example, the spec seems to define javax.webbeans.Component  
instead of ComponentFactory, but that conflicts with the  
@javax.webbeans.Component annotation.   In other words, the spec  
can't possibly be correct.

The annotations and bean/component are solid.  It's just the API  
that's a bit of a mess.

-- Scott

 How could I do this?

 - Original Message -
 From: wesley [EMAIL PROTECTED]
 To: General Discussion for the Resin application server
 resin-interest@caucho.com
 Sent: Friday, December 21, 2007 8:06 PM
 Subject: [Resin-interest] How Resin/Ioc used for struts2/ 
 xwork2,need an
 ObjectFactory implementation


 I'm using Struts2 in nearly every new projects these days, with  
 Guice as
 the
 IoC injector.
 I want to switch to Resin's WebBeans implementation and Resin/IoC.
 One of the main concerns is that I could not figure out how to  
 write a
 ObjectFactory implementation using
 Resin/IoC/WebBeans infrastucture, like Guice/Spring did.

 Could anyone provide me an example or some instructions/tips for  
 me to
 follow?
 Thanks very much.

 Wesley



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Memory leak in mod_caucho.so

2007-12-21 Thread Sam
 We are using Resin 3.1.4 with Apache 1.3.39. If mod_caucho.so is
 active in httpd.conf and Resin is running, httpd processes become
 utilizing more and more RAM (each one getting about and more than 100
 Megs for Virtual and Resident memory values). When mod_causho is not
 active, Apache does not use more than 30 Megs for each of the both RAM
 numbers. The same behaviour was for Resin 3.1.3.
 
 Did anybody else have the same issue? How cant it be fixed? I don't
 mind debugging mod_causho.so, if I can get described how it can be
 done.

There is a bugtrack entry for this:
http://bugs.caucho.com/view.php?id=2249

(fixed for 3.1.5)

-- Sam


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] How Resin/Ioc used for struts2/xwork2, need an ObjectFactory implementation

2007-12-21 Thread wesley
Thanks Scott,
I tried already, both in Servlet and JSP or in an ObjectFactory 
implemetation class, but got null ComponentFactory instance.

My test JSP:

%@ page contentType=text/html;charset=UTF-8 language=java %
%@ page import=javax.webbeans.Container %
%@ page import=com.caucho.webbeans.manager.WebBeansContainer %
%@ page import=javax.webbeans.ComponentFactory %
html
  headtitleSimple jsp page/title/head
  body
  %
   Container container = WebBeansContainer.create();
   ComponentFactory factory = 
container.resolveByType(com.foo.bar.MyClass.class);
   out.print(my factory is  + factory);
  %

  /body
/html


and com.foo.bar.MyClass was annotationed with @Component (or unneccesary?).

The html output is:

my factory is null


Did I miss something or there should be some extra config work to do in 
resin-web.xml like ELSolver?



- Original Message - 
From: Scott Ferguson [EMAIL PROTECTED]
To: General Discussion for the Resin application server 
resin-interest@caucho.com
Sent: Saturday, December 22, 2007 12:24 AM
Subject: Re: [Resin-interest] How Resin/Ioc used for struts2/xwork2,need an 
ObjectFactory implementation



 On Dec 21, 2007, at 7:15 AM, wesley wrote:

 To implement a com.opensymphony.xwork2.ObjectFactory, we should
 override
 method
 public Object buildBean(Class clazz, Map extraContext);
 and create/obtain a bean instance of specified bean class (provided
 by param
 clazz).

 I think I may get a WebBeansContainer instance as follow
 WebBeansContainer container = WebBeansContainer.create();
 and then use it to create/obtain bean instance.

 You can treat it as:

 javax.webbeans.Container container = WebBeansContainer.create();

 Then use

 javax.webbeans.ComponentFactory component = container.resolveByType
 (clazz);

 And then

   return component.get();

 (or component.create(); if you want to force a creation)

 The API piece of the webbeans draft spec/implementation is sketchy by
 the way.  So it's very likely the specifics will change in the next
 version of Resin.  In other words, it's fine as a temporary bridge
 for things like structs2/xwork2.

 For example, the spec seems to define javax.webbeans.Component
 instead of ComponentFactory, but that conflicts with the
 @javax.webbeans.Component annotation.   In other words, the spec
 can't possibly be correct.

 The annotations and bean/component are solid.  It's just the API
 that's a bit of a mess.

 -- Scott

 How could I do this?

 - Original Message -
 From: wesley [EMAIL PROTECTED]
 To: General Discussion for the Resin application server
 resin-interest@caucho.com
 Sent: Friday, December 21, 2007 8:06 PM
 Subject: [Resin-interest] How Resin/Ioc used for struts2/
 xwork2,need an
 ObjectFactory implementation


 I'm using Struts2 in nearly every new projects these days, with
 Guice as
 the
 IoC injector.
 I want to switch to Resin's WebBeans implementation and Resin/IoC.
 One of the main concerns is that I could not figure out how to
 write a
 ObjectFactory implementation using
 Resin/IoC/WebBeans infrastucture, like Guice/Spring did.

 Could anyone provide me an example or some instructions/tips for
 me to
 follow?
 Thanks very much.

 Wesley



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
 



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest