Hi again, 

this is just for curiosity but maybe some T5Guru has a clear explanation:

        Do PerThread scoped services needs an interface + implementation ?

I am curios because I noticed these different behaviors:

I setup a registry using t5 - 3.6, define my Module Class with one service 
annotated with PerThread Scope. The service depends on other services, and 
symbols. 

On my Mac, Everything is working fine, running it using mvn exec:java, and 
withing eclipse

On my Linux (Ubuntu 12.04) virtual machine I git-pulled the very same project 
and run with the same configurations (startup options, dependencies, etc.). In 
this case however I got an exception on startup (see below ):

As suggested by the exception, I refactored my code such that ServiceDeployer 
has an interface and an implementation. And everything seems to work just fine.
However, I am curios about the different behavior of the same java code on the 
two machines.

-- Alessio


===== Trace =====

2013-05-14 12:35:11,206 [at.ac.tuwien.dsg.cloud.CloudDriver.main()] INFO  
org.apache.tapestry5.ioc.RegistryBuilder - Adding module definition for class 
org.apache.tapestry5.ioc.services.TapestryIOCModule
2013-05-14 12:35:11,309 [at.ac.tuwien.dsg.cloud.CloudDriver.main()] INFO  
org.apache.tapestry5.ioc.RegistryBuilder - Adding module definition for class 
at.ac.tuwien.dsg.cloud.modules.CloudAppModule
2013-05-14 12:35:11,570 [at.ac.tuwien.dsg.cloud.CloudDriver.main()] INFO  
at.ac.tuwien.dsg.cloud.services.impl.ConfigurationFileSymbolProvider - 
Properties read from /home/ubuntu/elasticTest/euca-interface/src/
main/resources/cloud.properties
2013-05-14 12:35:11,570 [at.ac.tuwien.dsg.cloud.CloudDriver.main()] INFO  
at.ac.tuwien.dsg.cloud.services.impl.ConfigurationFileSymbolProvider - 
[ch.usi.cloud.controller.eucalyptus.accessKey, ch.usi.cloud.contr
oller.eucalyptus.ccPort, ch.usi.cloud.nova.userName, 
ch.usi.cloud.nova.tenant.id, ch.usi.cloud.nova.tenant.name, 
ch.usi.cloud.controller.eucalyptus.secretKey, 
ch.usi.cloud.controller.eucalyptus.ccAddress, ch.us
i.cloud.nova.password]
2013-05-14 12:35:11,682 [at.ac.tuwien.dsg.cloud.CloudDriver.main()] ERROR 
org.apache.tapestry5.ioc.Registry - Error building service proxy for service 
'ServiceDeployer' (at at.ac.tuwien.dsg.cloud.modules.CloudA
ppModule.buildServiceDeployer(String, String, String, Integer, 
EucalyptusController, EucaServiceStateDBInterface, CloudInterface) (at 
CloudAppModule.java:109)): Service scope 'perthread' requires a proxy, but t
he service does not have a service interface (necessary to create a proxy). 
Provide a service interface or select a different service scope.
2013-05-14 12:35:11,682 [at.ac.tuwien.dsg.cloud.CloudDriver.main()] ERROR 
org.apache.tapestry5.ioc.Registry - Operations trace:
2013-05-14 12:35:11,682 [at.ac.tuwien.dsg.cloud.CloudDriver.main()] ERROR 
org.apache.tapestry5.ioc.Registry - [ 1] Creating non-proxied instance of 
service ServiceDeployer
[WARNING]
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)   
     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
        at java.lang.Thread.run(Thread.java:679)
Caused by: org.apache.tapestry5.ioc.internal.OperationException: Error building 
service proxy for service 'ServiceDeployer' (at 
at.ac.tuwien.dsg.cloud.modules.CloudAppModule.buildServiceDeployer(String, 
String,
 String, Integer, EucalyptusController, EucaServiceStateDBInterface, 
CloudInterface) (at CloudAppModule.java:109)): Service scope 'perthread' 
requires a proxy, but the service does not have a service interface (necessary 
to create a proxy). Provide a service interface or select a different service 
scope.
        at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
        at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
        at 
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
        at 
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
        at 
org.apache.tapestry5.ioc.internal.ModuleImpl.create(ModuleImpl.java:332)
        at 
org.apache.tapestry5.ioc.internal.ModuleImpl.access$100(ModuleImpl.java:39)
        at 
org.apache.tapestry5.ioc.internal.ModuleImpl$1.invoke(ModuleImpl.java:191)
        at 
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withWrite(ConcurrentBarrier.java:140)
        at 
org.apache.tapestry5.ioc.internal.ModuleImpl$2.invoke(ModuleImpl.java:207)
        at 
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
        at 
org.apache.tapestry5.ioc.internal.ModuleImpl.findOrCreate(ModuleImpl.java:213)
        at 
org.apache.tapestry5.ioc.internal.ModuleImpl.getService(ModuleImpl.java:109)
        at 
org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:421)
        at 
org.apache.tapestry5.ioc.internal.RegistryImpl.getServiceByTypeAlone(RegistryImpl.java:670)
        at 
org.apache.tapestry5.ioc.internal.RegistryImpl.getServiceByTypeAndMarkers(RegistryImpl.java:684)
        at 
org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:643)
        at 
org.apache.tapestry5.ioc.internal.RegistryWrapper.getService(RegistryWrapper.java:60)
        at at.ac.tuwien.dsg.cloud.CloudDriver.main(CloudDriver.java:58)
        ... 6 more
Caused by: java.lang.RuntimeException: Error building service proxy for service 
'ServiceDeployer' (at 
at.ac.tuwien.dsg.cloud.modules.CloudAppModule.buildServiceDeployer(String, 
String, String, Integer, Eucalypt
usController, EucaServiceStateDBInterface, CloudInterface) (at 
CloudAppModule.java:109)): Service scope 'perthread' requires a proxy, but the 
service does not have a service interface (necessary to create a pro
xy). Provide a service interface or select a different service scope.
        at 
org.apache.tapestry5.ioc.internal.ModuleImpl$4.invoke(ModuleImpl.java:327)
        at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
        ... 22 more
Caused by: java.lang.IllegalArgumentException: Service scope 'perthread' 
requires a proxy, but the service does not have a service interface (necessary 
to create a proxy). Provide a service interface or select 
a different service scope.





On May 11, 2013, at 5:43 PM, Alessio Gambi wrote:

> Hi,
> 
> I ended up in creating a brand new file called IOCStrings.properties  and put 
> it in the org/apache/tapestry5/ioc/internal.
> 
> I filled the file with the content of the same file but taken from the 
> version number 5.3.5... Apparently in the version 5.3.6 that I downloaded the 
> file is missing...
> 
> I cannot explain how I managed to remove it (if the file was there).
> 
> Any suggestion is welcome.
> 
> -- Alessio
> 
> 
> On May 11, 2013, at 4:50 PM, Alessio Gambi wrote:
> 
>> Hi all,
>> 
>> maybe I have overlook something but I cannot figure out why the registry 
>> fails at startup.
>> 
>> The "funny" thing is that it worked yesterday and this morning, then it 
>> stopped...
>> 
>> I am using eclispe, m2eclips, and mvn, but also mvn directly from the 
>> command line (I need to run mvn through a SOCKS proxy)
>> 
>> From the exception I see that the problem might not be strictly due to 
>> Tapestry ... but maybe someone can help on how to approach/solve this.
>> 
>> 
>> Many thanks.
>> 
>> -- Alessio
>> 
>> 
>> Here my configuration (pom.xml):
>> 
>>              <!-- Use Tap5 IoC for the setup/conf/DI and so on -->
>>              <dependency>
>>                      <groupId>org.apache.tapestry</groupId>
>>                      <artifactId>tapestry-ioc</artifactId>
>>                      <version>5.3.6</version>
>>              </dependency>
>>              
>> 
>> Here my code:
>> 
>> public static void main(String[] args) throws Exception {
>> 
>>              RegistryBuilder builder = new RegistryBuilder();
>>              Registry registry = builder.build();
>>              registry.performRegistryStartup();
>> }
>> 
>> Here the console output:
>> 
>> 2013-05-11 16:43:28,956 [main] INFO  
>> org.apache.tapestry5.ioc.RegistryBuilder - Adding module definition for 
>> class org.apache.tapestry5.ioc.services.TapestryIOCModule
>> Contributions for 
>> org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl(List) (at 
>> SymbolSourceImpl.java:198) via 
>> org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at 
>> TapestryIOCModule.java:49)
>> [
>> 
>> Location : 
>> org.apache.tapestry5.ioc.services.TapestryIOCModule.setupStandardSymbolProviders(OrderedConfiguration,
>>  SymbolProvider, SymbolProvider) (at TapestryIOCModule.java:474)
>> ContributionMethod : 
>> setupStandardSymbolProviders(org.apache.tapestry5.ioc.OrderedConfiguration<org.apache.tapestry5.ioc.services.SymbolProvider>
>>  interface org.apache.tapestry5.ioc.services.SymbolProvider interface 
>> org.apache.tapestry5.ioc.services.SymbolProvider )]
>> 2013-05-11 16:43:29,108 [main] DEBUG org.apache.tapestry5.ioc.Registry - [  
>> 1] --> Eager loading services
>> 2013-05-11 16:43:29,110 [main] DEBUG org.apache.tapestry5.ioc.Registry - [  
>> 1] <-- Eager loading services [0.52 ms]
>> 2013-05-11 16:43:29,111 [main] DEBUG 
>> org.apache.tapestry5.ioc.services.TapestryIOCModule.RegistryStartup - 
>> Creating proxy for service RegistryStartup
>> 2013-05-11 16:43:29,112 [main] DEBUG org.apache.tapestry5.ioc.Registry - [  
>> 1] --> Creating proxy for service RegistryStartup
>> .2013-05-11 16:43:29,118 [main] DEBUG org.apache.tapestry5.ioc.Registry - [  
>> 2] --> Creating plan to instantiate 
>> org.apache.tapestry5.ioc.internal.services.RegistryStartup via public 
>> org.apache.tapestry5.ioc.internal.services.RegistryStartup(org.slf4j.Logger,java.util.List)
>> 2013-05-11 16:43:29,121 [main] DEBUG org.apache.tapestry5.ioc.Registry - [  
>> 3] --> Determining injection value for parameter #1 (org.slf4j.Logger)
>> 2013-05-11 16:43:29,123 [main] DEBUG org.apache.tapestry5.ioc.Registry - [  
>> 3] <-- Determining injection value for parameter #1 (org.slf4j.Logger) [1.99 
>> ms]
>> 2013-05-11 16:43:29,123 [main] DEBUG org.apache.tapestry5.ioc.Registry - [  
>> 3] --> Determining injection value for parameter #2 (java.util.List)
>> 2013-05-11 16:43:29,124 [main] DEBUG org.apache.tapestry5.ioc.Registry - [  
>> 4] --> Collecting ordered configuration for service RegistryStartup
>> 2013-05-11 16:43:29,128 [main] DEBUG org.apache.tapestry5.ioc.Registry - [  
>> 4] <-- Collecting ordered configuration for service RegistryStartup [4.14 ms]
>> 2013-05-11 16:43:29,133 [main] ERROR org.apache.tapestry5.ioc.Registry - 
>> java.lang.ExceptionInInitializerError
>> 2013-05-11 16:43:29,133 [main] ERROR org.apache.tapestry5.ioc.Registry - 
>> Operations trace:
>> 2013-05-11 16:43:29,133 [main] ERROR org.apache.tapestry5.ioc.Registry - [ 
>> 1] Creating proxy for service RegistryStartup
>> 2013-05-11 16:43:29,133 [main] ERROR org.apache.tapestry5.ioc.Registry - [ 
>> 2] Creating plan to instantiate 
>> org.apache.tapestry5.ioc.internal.services.RegistryStartup via public 
>> org.apache.tapestry5.ioc.internal.services.RegistryStartup(org.slf4j.Logger,java.util.List)
>> 2013-05-11 16:43:29,134 [main] ERROR org.apache.tapestry5.ioc.Registry - [ 
>> 3] Determining injection value for parameter #2 (java.util.List)
>> Exception in thread "main" java.lang.ExceptionInInitializerError
>>      at 
>> org.apache.tapestry5.ioc.internal.ServiceResourcesImpl.logConfiguration(ServiceResourcesImpl.java:100)
>>      at 
>> org.apache.tapestry5.ioc.internal.ServiceResourcesImpl.getOrderedConfiguration(ServiceResourcesImpl.java:114)
>>      at 
>> org.apache.tapestry5.ioc.internal.AbstractServiceCreator.getOrderedConfiguration(AbstractServiceCreator.java:123)
>>      at 
>> org.apache.tapestry5.ioc.internal.AbstractServiceCreator.access$200(AbstractServiceCreator.java:35)
>>      at 
>> org.apache.tapestry5.ioc.internal.AbstractServiceCreator$1.findResource(AbstractServiceCreator.java:103)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.DelegatingInjectionResources.findResource(DelegatingInjectionResources.java:38)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateInjection(InternalUtils.java:231)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.InternalUtils.access$000(InternalUtils.java:50)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.InternalUtils$4.invoke(InternalUtils.java:289)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.InternalUtils$4.invoke(InternalUtils.java:286)
>>      at 
>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
>>      at 
>> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
>>      at 
>> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1209)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:293)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.InternalUtils$23.invoke(InternalUtils.java:1488)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.InternalUtils$23.invoke(InternalUtils.java:1483)
>>      at 
>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
>>      at 
>> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
>>      at 
>> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1209)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.InternalUtils.createConstructorConstructionPlan(InternalUtils.java:1480)
>>      at 
>> org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.getPlan(ConstructorServiceCreator.java:52)
>>      at 
>> org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:61)
>>      at 
>> org.apache.tapestry5.ioc.internal.ModuleImpl$4.invoke(ModuleImpl.java:274)
>>      at 
>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
>>      at 
>> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
>>      at 
>> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1209)
>>      at 
>> org.apache.tapestry5.ioc.internal.ModuleImpl.create(ModuleImpl.java:339)
>>      at 
>> org.apache.tapestry5.ioc.internal.ModuleImpl.access$100(ModuleImpl.java:39)
>>      at 
>> org.apache.tapestry5.ioc.internal.ModuleImpl$1.invoke(ModuleImpl.java:191)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withWrite(ConcurrentBarrier.java:140)
>>      at 
>> org.apache.tapestry5.ioc.internal.ModuleImpl$2.invoke(ModuleImpl.java:207)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
>>      at 
>> org.apache.tapestry5.ioc.internal.ModuleImpl.findOrCreate(ModuleImpl.java:213)
>>      at 
>> org.apache.tapestry5.ioc.internal.ModuleImpl.getService(ModuleImpl.java:109)
>>      at 
>> org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:498)
>>      at 
>> org.apache.tapestry5.ioc.internal.RegistryImpl.performRegistryStartup(RegistryImpl.java:411)
>>      at 
>> org.apache.tapestry5.ioc.internal.RegistryWrapper.performRegistryStartup(RegistryWrapper.java:80)
>>      at at.ac.tuwien.dsg.cloud.CloudDriver.main(CloudDriver.java:24)
>> Caused by: java.util.MissingResourceException: Can't find bundle for base 
>> name org.apache.tapestry5.ioc.internal.IOCStrings, locale en_US
>>      at 
>> java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
>>      at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
>>      at java.util.ResourceBundle.getBundle(ResourceBundle.java:952)
>>      at 
>> org.apache.tapestry5.ioc.internal.util.MessagesImpl.forClass(MessagesImpl.java:46)
>>      at 
>> org.apache.tapestry5.ioc.internal.IOCMessages.<clinit>(IOCMessages.java:40)
>>      ... 38 more
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to