Re: Problem in starting up T5 registry (not web app)

2013-05-14 Thread Alessio Gambi
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 

Re: Problem in starting up T5 registry (not web app)

2013-05-14 Thread Thiago H de Paula Figueiredo
On Tue, 14 May 2013 11:02:24 -0300, Alessio Gambi alessioga...@gmail.com  
wrote:



Hi again,


Hi!


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

Do PerThread scoped services needs an interface + implementation ?


I think so. Look at the error message:

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.


That's the explanation I'd give before reading the error message above.  
The difference between machines is probably due to different code or  
different Tapestry versions. Otherwise, I have no idea.


--
Thiago H. de Paula Figueiredo

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



Problem in starting up T5 registry (not web app)

2013-05-11 Thread Alessio Gambi
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
groupIdorg.apache.tapestry/groupId
artifactIdtapestry-ioc/artifactId
version5.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.OrderedConfigurationorg.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 

Re: Problem in starting up T5 registry (not web app)

2013-05-11 Thread Alessio Gambi
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
   groupIdorg.apache.tapestry/groupId
   artifactIdtapestry-ioc/artifactId
   version5.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.OrderedConfigurationorg.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