Re: Newbie question about on WOInject (so for Henrique)
Re: Newbie question about on WOInject (so for Henrique)
- Subject: Re: Newbie question about on WOInject (so for Henrique)
- From: Ron X <email@hidden>
- Date: Wed, 04 Apr 2012 18:24:54 +0300
i have created simple app:
package com.ronx;
import com.google.inject.Module;
import com.woinject.InjectableApplication;
import com.woinject.WOInject;
public class Application extends InjectableApplication {
public static void main(String[] argv) {
WOInject.init("com.ronx.Application", argv);
}
@Override
protected Module[] modules() {
return new Module[] { };
}
public Application() {
}
}
package com.ronx.module;
import com.google.inject.AbstractModule;
/**
* @author user
*
*/
public class SocialModule extends AbstractModule {
@Override
protected void configure() {
}
}
so i have:
[2012-4-4 8:20:50 PDT] <main> Initialized : er.extensions.ERXExtensions
[2012-4-4 8:20:51 PDT] <main> A fatal exception occurred: null
[2012-4-4 8:20:51 PDT] <main> java.lang.ExceptionInInitializerError
at com.webobjects.appserver.WOResourceManager.__getJavaWebObjectsResourceAsStream(WOResourceManager.java:116)
at com.webobjects.appserver._private.WOProperties.initUserDefaultsKeys(WOProperties.java:317)
at com.webobjects.appserver.WOApplication._initWOApp(WOApplication.java:5743)
at com.webobjects.appserver.WOApplication.<init>(WOApplication.java:779)
at er.extensions.appserver.ajax.ERXAjaxApplication.<init>(ERXAjaxApplication.java:24)
at er.extensions.appserver.ERXApplication.<init>(ERXApplication.java:1093)
at com.woinject.InjectableApplication.<init>(InjectableApplication.java:61)
at com.ronx.Application.<init>(Application.java:18)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
at er.extensions.appserver.ERXApplication.main(ERXApplication.java:825)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.woinject.WOInject.init(WOInject.java:85)
at com.ronx.Application.main(Application.java:10)
Caused by: java.lang.IllegalStateException: Main bundle 'Properties' file can't be read. Did you run as a Java Application instead of a WOApplication in WOLips?
Please post your deployment configuration in the Wonder mailing list.
at er.extensions.appserver.ERXApplication$Loader.collectMainProps(ERXApplication.java:744)
at er.extensions.appserver.ERXApplication$Loader.bundleDidLoad(ERXApplication.java:641)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
at com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588)
at com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532)
at com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:562)
at com.webobjects.foundation.NSBundle.postNotification(NSBundle.java:2546)
at com.webobjects.foundation.NSBundle.LoadBundlesFromJars(NSBundle.java:735)
at com.webobjects.foundation.NSBundle.<clinit>(NSBundle.java:345)
... 22 more
and when i add
return new Module[] { new SocialModule()};
i have compilation error - it could not find the SocialModule.java...
why does it happen?
p.s. i use ERExtentions version 5.6-SNAPSHOT with maven.
4 апреля 2012 г. 17:37 пользователь Philippe Rabier
<email@hidden> написал:
Thanks for your replies/feedback Henrique and James.
Happy you are to have an average transaction of 10ms. I'm fighting against Mysql at this moment. But it's another problem ;-)
Philippe
Sent from my iPhone
On 4 avr. 2012, at 09:17, "Brook, James" <
email@hidden> wrote:
>
>
> Sent from my iPhone
>
>>> - is the injection mechanism efficient (in our case, a new object is created each time there is an http request)?
>>
>> I still don't have any benchmarks comparing an application running with WOInject and without it. Our empirical analysis didn't capture any discrepancies over the application performance after the addition of WOInject. I'll try to produce meaningful numbers when I finish a refactoring in the WOInject initialization code. I'll probably replace the Javassist library by ASM, which can lead to smaller performance gains.
>
> We have been using Guice to inject per request in a live app for over a year. The requests are all ERRest with an in memory database behind. Even at load we see sub 10ms response times in WOStats.
>
>>
>> Anyway, if you want to check it out, you can configure one application to use WOInject in a few minutes. Even if you don't configure any Guice module, components, EOs, DirectActions and Sessions will be created by Guice. Other internal WebObjects classes will be instantiated via reflection, and I'll be injected after that. If you feel your application is slow after the change, let me know.
>>
>> [1]
https://github.com/hprange/woinject/issues/1
>>
>> Cheers,
>>
>> Henrique
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (
email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (
email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden