XStream in java agent

I’m trying to get XStream working in my java agent as an Object to XML serializer and deserializer. I keep getting the following exception when i run the agent:

06/16/2005 09:47:31 AM HTTP JVM: java.lang.SecurityException: class java.util.Properties

06/16/2005 09:47:31 AM HTTP JVM: at lotus.notes.AgentSecurityManager.checkMemberAccess(AgentSecurityManager.java:404)

06/16/2005 09:47:31 AM HTTP JVM: at java.lang.Class.checkMemberAccess(Class.java:1377)

06/16/2005 09:47:31 AM HTTP JVM: at java.lang.Class.getDeclaredField(Class.java:1152)

06/16/2005 09:47:31 AM HTTP JVM: at com.thoughtworks.xstream.core.util.Fields.find(Fields.java:14)

06/16/2005 09:47:31 AM HTTP JVM: at com.thoughtworks.xstream.converters.collections.PropertiesConverter.(PropertiesConverter.java:30)

06/16/2005 09:47:31 AM HTTP JVM: at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:336)

06/16/2005 09:47:31 AM HTTP JVM: at com.thoughtworks.xstream.XStream.(XStream.java:196)

06/16/2005 09:47:31 AM HTTP JVM: at com.thoughtworks.xstream.XStream.(XStream.java:181)

06/16/2005 09:47:31 AM HTTP JVM: at com.thoughtworks.xstream.XStream.(XStream.java:156)

06/16/2005 09:47:31 AM HTTP JVM: at JavaAgent.NotesMain(JavaAgent.java:25)

06/16/2005 09:47:31 AM HTTP JVM: at lotus.domino.AgentBase.runNotes(Unknown Source)

06/16/2005 09:47:31 AM HTTP JVM: at lotus.domino.NotesThread.run(NotesThread.java:215)

I’ve already tried putting the agent runtime security level to 2 or 3 but no change.

Does anybody have any clue of what I’m doing wrong?

Subject: XStream in java agent

Have you added the agent signer to the ‘Run unrestricted methods and operations:’ section in the server document?

George :slight_smile:

Subject: RE: XStream in java agent

Yes I did already do that.

Subject: RE: XStream in java agent

I’m very sorry I can’t be more help. Have you resolved this? Have you tried giving everyone manager access? Sometimes in these situations I start with maximum access and take a level away progressively to see where the rights access error is happening.

Subject: RE: XStream in java agent

Thanx for your reaction. I haven’t been able to resolve this problem. I’ve tried all the options you mentioned but without any luck. I got tired of it so I guess I’m just gonna use servlet container instead of a java agent.

Subject: RE: XStream in java agent

As I was fiddling around with using XStream in a servlet I’ve seemed to have resolved the whole issue. The problem lies in the java.poilicy file in the %java.home%\lib\security directory on the server. I added the following line to standard extension portion:

permission java.lang.reflect.ReflectPermission “suppressAccessChecks”, “”;

I also added the XStream jar packages to the %java.home%\lib\ext directory on the domino server.

Now it works fine in my java agent. I’m not sure if this poses a security breach though. Does anyone have any clue about that?

Subject: RE: XStream in java agent

That’s interesting. The whole way that the Java in Domino works as a machine within a machine could be the culprit. As for a security breach, I don’t know. If you take away the right to run unrestricted agents in the server document does it still work?