Return-Path: Delivered-To: apmail-jakarta-hivemind-user-archive@www.apache.org Received: (qmail 72037 invoked from network); 16 Apr 2005 14:48:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Apr 2005 14:48:45 -0000 Received: (qmail 7220 invoked by uid 500); 16 Apr 2005 14:48:44 -0000 Delivered-To: apmail-jakarta-hivemind-user-archive@jakarta.apache.org Received: (qmail 7200 invoked by uid 500); 16 Apr 2005 14:48:43 -0000 Mailing-List: contact hivemind-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: hivemind-user@jakarta.apache.org Delivered-To: mailing list hivemind-user@jakarta.apache.org Received: (qmail 7186 invoked by uid 99); 16 Apr 2005 14:48:43 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_30_40,HTML_MESSAGE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of hlship@gmail.com designates 64.233.184.206 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.206) by apache.org (qpsmtpd/0.28) with ESMTP; Sat, 16 Apr 2005 07:48:40 -0700 Received: by wproxy.gmail.com with SMTP id 71so1018063wri for ; Sat, 16 Apr 2005 07:48:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=S64CeXcmCfpDTzw5mMNdokXmRwTzi9d9HSaL+P1mV5UwEjDv8p/uD02ZCsdS9/t6wp/RbhKhLc8tJEAnNorUh/GoF0bE6C9SiRIf9VbHanxGMk8T6eSHEo2idEOej9xBfWeaZEZs9cTKvc1tQtqH3W7hf9DdzP4sM319ngWNedU= Received: by 10.54.69.3 with SMTP id r3mr21665wra; Sat, 16 Apr 2005 07:48:38 -0700 (PDT) Received: by 10.54.31.47 with HTTP; Sat, 16 Apr 2005 07:48:35 -0700 (PDT) Message-ID: Date: Sat, 16 Apr 2005 10:48:35 -0400 From: Howard Lewis Ship Reply-To: Howard Lewis Ship To: hivemind-user@jakarta.apache.org Subject: Re: Problem with hivemind.lib.ServicePropertyFactory In-Reply-To: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2286_7140463.1113662915548" References: X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_2286_7140463.1113662915548 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline There were bugs in HiveMind 1.0 where a service that inherited different=20 implementations of the same method (with different thrown exceptions) would= =20 trip up the interceptor building code. It would tend to try and add the sam= e=20 method, with different thrown exceptions, twice. That is fixed in 1.1, it= =20 does a more sophisticated job of enumerating the methods, and skips methods= =20 that are "trumped" by other methods (with same parameters, but more=20 inclusive thrown exceptions). I suspect that could be the problem. On 4/13/05, Hensley, Richard wrote: >=20 > Upon further study, it seems that the user of interceptors is causing the > problem. >=20 > interface=3D"com.mckesson.lab.services.ApplicationVisitContext"> > >=20 > >=20 > > class=3D"com.mckesson.lab.services.impl.ApplicationVisitContextImpl" > model=3D"threaded" /> > >=20 > This configuration fails with the exception noted below. >=20 > The same configuration without the interceptor works correctly. > interface=3D"com.mckesson.lab.services.ApplicationVisitContext"> > >=20 > > class=3D"com.mckesson.lab.services.impl.ApplicationVisitContextImpl" > model=3D"threaded" /> > >=20 > I can work around this in Hivemind 1.0, can anybody tell me if Hivemind= =20 > 1.1 > exhibits the same behavior? >=20 > Richard >=20 > -----Original Message----- > From: Hensley, Richard [mailto:Richard.Hensley@McKesson.com] > Sent: Tuesday, April 12, 2005 5:33 PM > To: hivemind-user@jakarta.apache.org > Subject: RE: Problem with hivemind.lib.ServicePropertyFactory >=20 > However, when I use this configuration: >=20 > interface=3D"com.mckesson.lab.services.ApplicationVisitContext"> > class=3D"com.mckesson.lab.services.impl.ApplicationVisitContextImpl" > model=3D"threaded" /> > >=20 > interface=3D"com.mckesson.lab.objects.security.User"> > service-id=3D"hivemind.lib.ServicePropertyFactory"> > > > >=20 > Which simply does not use a separation of service and implementation, the > code works as expected. I'm trying to track this down, but I got lost in= =20 > the > mire of ServicePropertyFactory. >=20 > Richard >=20 > -----Original Message----- > From: Hensley, Richard [mailto:Richard.Hensley@McKesson.com] > Sent: Tuesday, April 12, 2005 5:19 PM > To: hivemind-user@jakarta.apache.org > Subject: Problem with hivemind.lib.ServicePropertyFactory >=20 > I have the following configuration: >=20 > interface=3D"com.mckesson.lab.services.ApplicationVisitContext"> > >=20 > > >=20 > service-id=3D"com.mckesson.lab.services.ApplicationVisitContext"> > class=3D"com.mckesson.lab.services.impl.ApplicationVisitContextImpl" > model=3D"threaded" /> > >=20 > interface=3D"com.mckesson.lab.objects.security.User"> > service-id=3D"hivemind.lib.ServicePropertyFactory"> > service-id=3D"com.mckesson.lab.services.ApplicationVisitContext" > property=3D"user" /> > > >=20 > When I execute the following code: >=20 > public void testUserService() { > Registry registry =3D RegistryBuilder.constructDefaultRegistry(); > User user =3D (User) registry.getService(User.class); > user.getUserId(); > } >=20 > I get the following exception: >=20 > org.apache.hivemind.ApplicationRuntimeException: Unable to construct=20 > service > com.mckesson.lab.services.impl.User: Unable to add method > com.mckesson.lab.objects.security.User _targetServiceProperty() to class > $ServicePropertyProxy_10338ea728a_35: [source error] Method getUser not > found in com.mckesson.lab.objects.security.User > at >=20 > org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructN= ewS > erviceImplementation(AbstractServiceModelImpl.java:156) > at >=20 > org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructS= erv > iceImplementation(AbstractServiceModelImpl.java:130) > at >=20 > org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualServ= ice > Implementation(SingletonServiceModel.java:69) > at > $InnerProxy_10338ea7225_25._service($InnerProxy_10338ea7225_25.java) > at > $InnerProxy_10338ea7225_25.getUserId($InnerProxy_10338ea7225_25.java) > at >=20 > $SingletonProxy_10338ea7225_24.getUserId($SingletonProxy_10338ea7225_24.j= ava > ) > at > com.mckesson.lab.services.impl.UserServiceTest.testUserService > (UserServiceTe > st.java:21) > 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:324) > at junit.framework.TestCase.runTest(TestCase.java:154) > at junit.framework.TestCase.runBare(TestCase.java:127) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests > (RemoteTestRu > nner.java:436) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run > (RemoteTestRunner. > java:311) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main > (RemoteTestRunner > .java:192) > Caused by: org.apache.hivemind.ApplicationRuntimeException: Unable to add > method com.mckesson.lab.objects.security.User _targetServiceProperty() to > class $ServicePropertyProxy_10338ea728a_35: [source error] Method getUser > not found in com.mckesson.lab.objects.security.User > at >=20 > org.apache.hivemind.impl.InvokeFactoryServiceConstructor.constructCoreSer= vic > eImplementation(InvokeFactoryServiceConstructor.java:100) > at >=20 > org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructC= ore > ServiceImplementation(AbstractServiceModelImpl.java:100) > at >=20 > org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructN= ewS > erviceImplementation(AbstractServiceModelImpl.java:148) > ... 21 more > Caused by: org.apache.hivemind.ApplicationRuntimeException: Unable to add > method com.mckesson.lab.objects.security.User _targetServiceProperty() to > class $ServicePropertyProxy_10338ea728a_35: [source error] Method getUser > not found in com.mckesson.lab.objects.security.User > at > org.apache.hivemind.service.impl.ClassFabImpl.addMethod(ClassFabImpl.java > :11 > 0) > at > org.apache.hivemind.lib.impl.ServicePropertyFactory.addInfrastructure > (Servic > ePropertyFactory.java:116) > at >=20 > org.apache.hivemind.lib.impl.ServicePropertyFactory.createCoreServiceImpl= eme > ntation(ServicePropertyFactory.java:72) > at >=20 > $InnerProxy_10338ea722f_27.createCoreServiceImplementation($InnerProxy_10= 338 > ea722f_27.java) > at >=20 > $SingletonProxy_10338ea722f_26.createCoreServiceImplementation($Singleton= Pro > xy_10338ea722f_26.java) > at >=20 > org.apache.hivemind.impl.InvokeFactoryServiceConstructor.constructCoreSer= vic > eImplementation(InvokeFactoryServiceConstructor.java:91) > ... 23 more > Caused by: javassist.CannotCompileException: [source error] Method getUse= r > not found in com.mckesson.lab.objects.security.User > at javassist.CtBehavior.setBody(CtBehavior.java:163) > at javassist.CtMethod.setBody(CtMethod.java:311) > at > org.apache.hivemind.service.impl.ClassFabImpl.addMethod(ClassFabImpl.java > :10 > 2) > ... 28 more >=20 > It is telling me that it is trying to call getUser() on the User=20 > interface, > however this does not seem to be what the documentation says it is=20 > supposed > to be doing. >=20 > Does anybody have any suggestions as to what went wrong? >=20 > Richard >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: hivemind-user-help@jakarta.apache.org >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: hivemind-user-help@jakarta.apache.org >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: hivemind-user-help@jakarta.apache.org >=20 >=20 --=20 Howard M. Lewis Ship Independent J2EE / Open-Source Java Consultant Creator, Jakarta Tapestry Creator, Jakarta HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com ------=_Part_2286_7140463.1113662915548 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline There were bugs in HiveMind 1.0 where a service that inherited different implementations of the same method (with different thrown exceptions) would trip up the interceptor building code. It would tend to try and add the same method, with different thrown exceptions, twice. That is fixed in 1.1, it does a more sophisticated job of enumerating the methods, and skips methods that are "trumped" by = other methods (with same parameters, but more inclusive thrown exceptions). I suspect that could be the problem.


On 4/13/05, Hensley, Richard <Richard.Hensley@mckesson.com> wrote:
Upon further study, it seems that the user of interceptors is causing theproblem.

        <servi= ce-point id=3D"avc"
interface=3D"com.mckesson.lab.service= s.ApplicationVisitContext">
      =   <interceptor service-id=3D" com.mckesson.adept.TimerInterceptor" />

   &n= bsp;    </service-point>

   = ; <implementation service-id=3D"avc">
  &= nbsp;     <create-instance
class=3D"com= .mckesson.lab.services.impl.ApplicationVisitContextImpl "
model=3D"threaded" />
    <= ;/implementation>

This configuration fails with the exception not= ed below.

The same configuration without the interceptor works corre= ctly.
        <service-point = id=3D"avc"
interface=3D"com.mckesson.lab.services.ApplicationVisitContext&quo= t;>
        </service-poin= t>

    <implementation service-id=3D"= avc">
        <create= -instance
class=3D" com.mckesson.lab.services.impl.ApplicationVisitContextImpl"
model= =3D"threaded" />
    </implementatio= n>

I can work around this in Hivemind 1.0, can anybody tell me if= Hivemind 1.1
exhibits the same behavior?

Richard

-----Original Message-----
From: Hensley, Richard= [mailto:Richard.Hensley@Mc= Kesson.com]
Sent: Tuesday, April 12, 2005 5:33 PM
To: hivemind-user@jakarta.apache.org
Subject: RE: Problem with hivemind.= lib.ServicePropertyFactory

However, when I use this configuration:
        <service-point id= =3D"avc"
interface=3D"com.mckesson.lab.services.Applicati= onVisitContext ">
        <create-in= stance
class=3D"com.mckesson.lab.services.impl.ApplicationVisitCont= extImpl"
model=3D"threaded" />
   &n= bsp;    </service-point>

   = ; <service-point id=3D"User"
interface=3D"com.mckesson.lab.objects.security.User">
&= nbsp;       <invoke-factory model=3D&= quot;singleton"
service-id=3D"hivemind.lib.ServicePropertyFact= ory">
         &nbs= p;  <construct service-id=3D"avc" property=3D"u= ser" />
        </invoke-factory>=
    </service-point>

Which simply does= not use a separation of service and implementation, the
code works as e= xpected. I'm trying to track this down, but I got lost in the
mire of ServicePropertyFactory.

Richard

-----Original Mes= sage-----
From: Hensley, Richard [mailto:Richard.Hensley@McKesson.com]
Sent: Tuesday, April = 12, 2005 5:19 PM
To: hivemind-user@j= akarta.apache.org
Subject: Problem with hivemind.lib.ServiceProperty= Factory

I have the following configuration:

   = ; <service-point id=3D"ApplicationVisitContext"
interface=3D"com.mckesson.lab.services.ApplicationVisitContext&quo= t;>
        <interceptor s= ervice-id=3D"com.mckesson.adept.TimerInterceptor" />

&n= bsp;       <interceptor service-id=3D= "com.mckesson.adept.LoggerInterceptor " />
    </service-point>

 = ;   <implementation
service-id=3D"com.mckesson.la= b.services.ApplicationVisitContext">
    &nb= sp;   <create-instance
class=3D"com.mckesson.lab.= services.impl.ApplicationVisitContextImpl "
model=3D"threaded" />
    <= ;/implementation>

    <service-point id=3D= "User"
interface=3D"com.mckesson.lab.objects.security.Use= r">
        <invoke-f= actory model=3D"singleton"
service-id=3D"hivemind.lib.ServicePropertyFactory">
&nb= sp;           <co= nstruct
service-id=3D"com.mckesson.lab.services.ApplicationVisitCon= text"
property=3D"user" />
    =     </invoke-factory>
    </service-point>

When I execute th= e following code:

    public void testUserServic= e() {
        Registry registry = =3D RegistryBuilder.constructDefaultRegistry();
    =     User user =3D (User)=20 registry.getService(User.class);
      &nb= sp; user.getUserId();
    }

I get the fo= llowing exception:

org.apache.hivemind.ApplicationRuntimeException: = Unable to construct service
com.mckesson.lab.services.impl.User : Unable to add method
com.mckesson.lab.objects.security.User _targetSer= viceProperty() to class
$ServicePropertyProxy_10338ea728a_35: [source er= ror] Method getUser not
found in com.mckesson.lab.objects.security.User
        at
org.apache.hivemi= nd.impl.servicemodel.AbstractServiceModelImpl.constructNewS
erviceImplem= entation(AbstractServiceModelImpl.java:156)
    &nbs= p;   at
org.apache.hivemind.impl.servicemodel.AbstractSer= viceModelImpl.constructServ
iceImplementation(AbstractServiceModelImpl.java:130)
  &nb= sp;     at
org.apache.hivemind.impl.servicemode= l.SingletonServiceModel.getActualService
Implementation(SingletonService= Model.java:69)
        at
$In= nerProxy_10338ea7225_25._service($InnerProxy_10338ea7225_25.java)
        at
$InnerProxy_10338= ea7225_25.getUserId($InnerProxy_10338ea7225_25.java)
   &= nbsp;    at
$SingletonProxy_10338ea7225_24.getUserId= ($SingletonProxy_10338ea7225_24.java
)
     =    at
com.mckesson.lab.services.impl.UserServiceTest.test= UserService (UserServiceTe
st.java:21)
       =  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&nb= sp;       at
sun.reflect.NativeMethod= AccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
  &n= bsp;     at
sun.reflect.DelegatingMethodAccesso= rImpl.invoke (DelegatingMethodAccessorImpl
.java:25)
     = ;   at java.lang.reflect.Method.invoke(Method.java:324)
&= nbsp;       at junit.framework.TestCase.= runTest(TestCase.java:154)
       &nb= sp;at junit.framework.TestCase.runBare(TestCase.java :127)
        at junit.framework= .TestResult$1.protect(TestResult.java:106)
     = ;   at junit.framework.TestResult.runProtected(TestResult.ja= va:124)
        at junit.framewo= rk.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase= .run(TestCase.java:118)
        = at junit.framework.TestSuite.runTest(TestSuite.java:208)
  &nb= sp;     at junit.framework.TestSuite.run(TestSuite= .java:203)
        at
org.ecl= ipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRu
nner.java:436)
      &nbs= p; at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Re= moteTestRunner.
java:311)
       &= nbsp;at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Remo= teTestRunner
.java:192)
Caused by: org.apache.hivemind.ApplicationRuntimeExceptio= n: Unable to add
method com.mckesson.lab.objects.security.User _targetSe= rviceProperty() to
class $ServicePropertyProxy_10338ea728a_35: [source e= rror] Method getUser
not found in com.mckesson.lab.objects.security.User
  &nbs= p;     at
org.apache.hivemind.impl.InvokeFactor= yServiceConstructor.constructCoreServic
eImplementation(InvokeFactorySer= viceConstructor.java:100)
       &nbs= p;at
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.construc= tCore
ServiceImplementation(AbstractServiceModelImpl.java:100)
 =        at
org.apache.hivemind.impl.se= rvicemodel.AbstractServiceModelImpl.constructNewS
erviceImplementation(AbstractServiceModelImpl.java:148)
  =       ... 21 more
Caused by: org.apache.hi= vemind.ApplicationRuntimeException: Unable to add
method com.mckesson.la= b.objects.security.User _targetServiceProperty() to
class $ServicePropertyProxy_10338ea728a_35: [source error] Method getUs= er
not found in com.mckesson.lab.objects.security.User
  &n= bsp;     at
org.apache.hivemind.service.impl.Cl= assFabImpl.addMethod(ClassFabImpl.java :11
0)
        at
org.apac= he.hivemind.lib.impl.ServicePropertyFactory.addInfrastructure(Servic
ePr= opertyFactory.java:116)
        = at
org.apache.hivemind.lib.impl.ServicePropertyFactory.createCoreService= Impleme
ntation(ServicePropertyFactory.java:72)
    &nbs= p;   at
$InnerProxy_10338ea722f_27.createCoreServiceImple= mentation($InnerProxy_10338
ea722f_27.java)
    &= nbsp;   at
$SingletonProxy_10338ea722f_26.createCoreServi= ceImplementation($SingletonPro
xy_10338ea722f_26.java)
       &n= bsp;at
org.apache.hivemind.impl.InvokeFactoryServiceConstructor.construc= tCoreServic
eImplementation(InvokeFactoryServiceConstructor.java:91)
=         ... 23 more
Caused by: j= avassist.CannotCompileException : [source error] Method getUser
not found in com.mckesson.lab.objects.se= curity.User
        at javassist= .CtBehavior.setBody(CtBehavior.java:163)
     &= nbsp;  at javassist.CtMethod.setBody(CtMethod.java:311)
 =        at
org.apache.hivemind.service.impl.ClassFabImpl.addMethod(ClassFabImpl.ja= va:10
2)
        ... 28 more<= br>
It is telling me that it is trying to call getUser() on the User int= erface,
however this does not seem to be what the documentation says it = is supposed
to be doing.

Does anybody have any suggestions as to what went w= rong?

Richard

-----------------------------------------------= ----------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands= , e-mail: hivemind= -user-help@jakarta.apache.org

----------------------------------= -----------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For ad= ditional commands, e-mail: hivemind-user-help@jakarta.apache.org

--------------------------= -------------------------------------------
To unsubscribe, e-mail: hivemind-user-u= nsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org




--
Howard M. Lewis Ship
Independent J2EE= / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professio= nal Tapestry training, mentoring, support
and project work.  <= a href=3D"http://howardlewisship.com">http://howardlewisship.com ------=_Part_2286_7140463.1113662915548--