[Anthill-pro] AuthorizationException running sample remoting
script
Ryan Smith
rws at urbancode.com
Fri Mar 14 07:43:32 CST 2008
Ken,
It seems there a incompatibilities between the classes used by the remote script and those from the server. Any time there is a upgrade, you need to download the remoting package under the tools link. Do you have that latest?
Ryan Smith
Pacileo, Kenneth wrote:
> I'm getting an AuthorizationException trying to run the sample script from the help section "Chap 34 Remote Scripting". I created the test script and ran the ah3client.cmd passing in the test script. We are using AnthillPro 3.4.6 with JDK 1.5.0_12. What am I doing wrong?
>
> Regards,
> Ken
>
> Test script:
> import com.urbancode.anthill3.main.client.AnthillClient;
> import com.urbancode.anthill3.persistence.UnitOfWork;
> import com.urbancode.anthill3.domain.project.*;
>
> String serverHost = "localhost";
> int serverPort = 4567;
> String userName = "<username>"; /* Replaced here */
> String password = "<password>"; /* Replaced here */
>
> // obtain connection to the Anthill server
> AnthillClient anthill = AnthillClient.connect(serverHost, serverPort,
> userName, password);
>
> System.out.println("anthill object = " + anthill);
> System.out.println("executing anthill.createUnitOfWork()");
>
> // create a Unit of Work
> UnitOfWork uow = anthill.createUnitOfWork();
>
> // Project
> Project[] projects = ProjectFactory.getInstance().restoreAll();
>
> for (int i = 0; i < projects.length; i++) {
> print(projects[i].getName());
> }
>
> uow.commitAndClose();
>
>
> Output:
> E:\anthill3\server\opt\remoting\bin>ah3client.cmd testscript.txt
> CLASSPATH=..\conf\client;..\conf\spring-client;..\lib\anthill3-client.jar;..\lib\bsh-2.0b4-c1.jar;..\lib\devilfish.jar;
> ..\lib\log4j.jar;..\lib\CommonsNet.jar;..\lib\CommonsUtil.jar;..\lib\spring-core.jar;..\lib\spring-beans.jar;..\lib\commons-logging.jar;..\lib\commons-lang-2.1.jar
> anthill object = com.urbancode.anthill3.main.client.AnthillClient at e2dae9
> executing anthill.createUnitOfWork()
> Script threw exception: Sourced file: testscript.txt : Typed variable declaration : Method Invocation anthill.createUnit
> OfWork : at Line: 21 : in file: testscript.txt : anthill .createUnitOfWork ( )
>
> Target exception: com.urbancode.anthill3.domain.security.AuthorizationException: java.io.InvalidClassException: com.urba
> ncode.anthill3.persistence.remoting.common.SessionToken; local class incompatible: stream classdesc serialVersionUID = 1
> , local class serialVersionUID = 4083838054053219010
>
> com.urbancode.anthill3.domain.security.AuthorizationException: java.io.InvalidClassException: com.urbancode.anthill3.per
> sistence.remoting.common.SessionToken; local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = 4083838054053219010
> at com.urbancode.anthill3.persistence.remoting.client.UnitOfWorkClient.authenticate(UnitOfWorkClient.java:196)
> at com.urbancode.anthill3.main.client.AnthillClient.createUnitOfWork(AnthillClient.java:109)
> 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:585)
> at bsh.Reflect.invokeMethod(Unknown Source)
> at bsh.Reflect.invokeObjectMethod(Unknown Source)
> at bsh.Name.invokeMethod(Unknown Source)
> at bsh.BSHMethodInvocation.eval(Unknown Source)
> at bsh.BSHPrimaryExpression.eval(Unknown Source)
> at bsh.BSHPrimaryExpression.eval(Unknown Source)
> at bsh.BSHVariableDeclarator.eval(Unknown Source)
> at bsh.BSHTypedVariableDeclaration.eval(Unknown Source)
> at bsh.Interpreter.eval(Unknown Source)
> at bsh.Interpreter.source(Unknown Source)
> at bsh.Interpreter.main(Unknown Source)
> Caused by: java.io.InvalidClassException: com.urbancode.anthill3.persistence.remoting.common.SessionToken; local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = 4083838054053219010
> at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:546)
> at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552)
> at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
> at com.urbancode.devilfish.common.NetworkUtils.readObject(NetworkUtils.java:117)
> at com.urbancode.devilfish.common.NetworkUtils.readObject(NetworkUtils.java:109)
> at com.urbancode.anthill3.persistence.remoting.devilfish.RemoteUnitOfWorkServiceClient.authenticate(RemoteUnitOf
> WorkServiceClient.java:93)
> at com.urbancode.anthill3.persistence.remoting.client.UnitOfWorkClient.authenticate(UnitOfWorkClient.java:193)
> ... 16 more
>
> E:\anthill3\server\opt\remoting\bin>
>
>
>
>
>
> This e-mail, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity to
> which it is addressed. If the reader of this e-mail is not the intended
> recipient or his or her authorized agent, the reader is hereby notified
> that any dissemination, distribution or copying of this e-mail is
> prohibited. If you have received this e-mail in error, please notify the
> sender by replying to this message and delete this e-mail immediately.
>
> _______________________________________________
> Anthill-pro mailing list
> Anthill-pro at lists.urbancode.com
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>
--
===========================================================
Ryan Smith. 2044 Euclid Ave., Suite 600
Developer Cleveland, Ohio 44115
Urbancode, Inc.
email: rws at urbancode.com
web: www.urbancode.com phone: 216-858-9000
web: www.anthillpro.com fax: 216-858-9602
===========================================================
More information about the Anthill-pro
mailing list