Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] logging of session/user activity.
[CDO] logging of session/user activity. [message #687035] Tue, 24 May 2011 07:25 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi, We have a requirement to log activity per user. So this could be an
object being created, modified or deleted. It could also be a reference
being created, modified or deleted. Is there a capability in CDO to do
this (Server side), perhaps linking a CDOSession and CDOView ?

Thanks Christophe
Re: [CDO] logging of session/user activity. [message #687036 is a reply to message #687035] Tue, 24 May 2011 07:39 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Hi Christophe,

Please have a look at IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default handlers:

org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog

They've been added with:

333460: Would like to have all commit sets in a log file
https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 24.05.2011 09:25, schrieb Christophe Bouhier:
> Hi, We have a requirement to log activity per user. So this could be an object being created, modified or deleted. It could also be a reference being created, modified or deleted. Is there a capability in CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>
> Thanks Christophe


Re: [CDO] logging of session/user activity. [message #687037 is a reply to message #687036] Tue, 24 May 2011 07:49 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi Eike,

That's just great, thanks!
Christophe

On 24-05-11 09:39, Eike Stepper wrote:
> Hi Christophe,
>
> Please have a look at
> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
> handlers:
>
> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>
> They've been added with:
>
> 333460: Would like to have all commit sets in a log file
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>> Hi, We have a requirement to log activity per user. So this could be
>> an object being created, modified or deleted. It could also be a
>> reference being created, modified or deleted. Is there a capability in
>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>
>> Thanks Christophe
Re: [CDO] logging of session/user activity. [message #687055 is a reply to message #687037] Thu, 26 May 2011 07:53 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Eike,
The commit info needs to be added to the repository programmatically. What is a good place to do this? I mean the
repository should already be running so it can't be done in some Activator. Is there a logical place for these
repository configuration code?

gr. Martin

On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
> Hi Eike,
>
> That's just great, thanks!
> Christophe
>
> On 24-05-11 09:39, Eike Stepper wrote:
>> Hi Christophe,
>>
>> Please have a look at
>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>> handlers:
>>
>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>
>> They've been added with:
>>
>> 333460: Would like to have all commit sets in a log file
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>> Hi, We have a requirement to log activity per user. So this could be
>>> an object being created, modified or deleted. It could also be a
>>> reference being created, modified or deleted. Is there a capability in
>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>
>>> Thanks Christophe
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687056 is a reply to message #687055] Thu, 26 May 2011 08:18 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 26.05.2011 09:53, schrieb Martin Taal:
> Hi Eike,
> The commit info
commit info handler ;-)

> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should already be running
No, these handlers can be added/removed at any time.

> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>> Hi Eike,
>>
>> That's just great, thanks!
>> Christophe
>>
>> On 24-05-11 09:39, Eike Stepper wrote:
>>> Hi Christophe,
>>>
>>> Please have a look at
>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>> handlers:
>>>
>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>
>>> They've been added with:
>>>
>>> 333460: Would like to have all commit sets in a log file
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>> Hi, We have a requirement to log activity per user. So this could be
>>>> an object being created, modified or deleted. It could also be a
>>>> reference being created, modified or deleted. Is there a capability in
>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>
>>>> Thanks Christophe
>>
>
>


Re: [CDO] logging of session/user activity. [message #687057 is a reply to message #687056] Thu, 26 May 2011 08:57 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Yeah the commit info handler :-)

I have this in my activator:
final IManagedContainer container = IPluginContainer.INSTANCE;
final IRepository repo = CDOServerUtil.getRepository(container,
REPO_NAME);
final OutputStream os = new FileOutputStream(
"/home/mtaal/mytmp/test.commitinfo");
repo.addCommitInfoHandler(new TextCommitInfoLog(os));

but then I get this:


!ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
!MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
!STACK 0
org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
at java.lang.Thread.run(Thread.java:679)
Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
... 15 more
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
... 19 more
Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of bundle
com.netxforge.netxstudio.server.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
... 31 more
Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
org.eclipse.emf.cdo.server.repositories[default]
at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
... 37 more


On 05/26/2011 10:18 AM, Eike Stepper wrote:
> Am 26.05.2011 09:53, schrieb Martin Taal:
>> Hi Eike,
>> The commit info
> commit info handler ;-)
>
>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>> already be running
> No, these handlers can be added/removed at any time.
>
>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>> Hi Eike,
>>>
>>> That's just great, thanks!
>>> Christophe
>>>
>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>> Hi Christophe,
>>>>
>>>> Please have a look at
>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>> handlers:
>>>>
>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>
>>>> They've been added with:
>>>>
>>>> 333460: Would like to have all commit sets in a log file
>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>> an object being created, modified or deleted. It could also be a
>>>>> reference being created, modified or deleted. Is there a capability in
>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>
>>>>> Thanks Christophe
>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687059 is a reply to message #687057] Thu, 26 May 2011 09:22 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the time you call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the container a factory to create one. Can you post an executable example?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 26.05.2011 10:57, schrieb Martin Taal:
> Yeah the commit info handler :-)
>
> I have this in my activator:
> final IManagedContainer container = IPluginContainer.INSTANCE;
> final IRepository repo = CDOServerUtil.getRepository(container,
> REPO_NAME);
> final OutputStream os = new FileOutputStream(
> "/home/mtaal/mytmp/test.commitinfo");
> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>
> but then I get this:
>
>
> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
> !STACK 0
> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
> at java.lang.Thread.run(Thread.java:679)
> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
> at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
> ... 15 more
> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
> ... 19 more
> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of bundle com.netxforge.netxstudio.server.
> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
> ... 31 more
> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found: org.eclipse.emf.cdo.server.repositories[default]
> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
> at java.security.AccessController.doPrivileged(Native Method)
> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
> ... 37 more
>
>
> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>> Hi Eike,
>>> The commit info
>> commit info handler ;-)
>>
>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>> already be running
>> No, these handlers can be added/removed at any time.
>>
>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>> Hi Eike,
>>>>
>>>> That's just great, thanks!
>>>> Christophe
>>>>
>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>> Hi Christophe,
>>>>>
>>>>> Please have a look at
>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>> handlers:
>>>>>
>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>
>>>>> They've been added with:
>>>>>
>>>>> 333460: Would like to have all commit sets in a log file
>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>
>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>> an object being created, modified or deleted. It could also be a
>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>
>>>>>> Thanks Christophe
>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687060 is a reply to message #687059] Thu, 26 May 2011 10:15 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
ping when a repository is up and running?

gr. Martin

On 05/26/2011 11:22 AM, Eike Stepper wrote:
> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the time you
> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the container a
> factory to create one. Can you post an executable example?
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 26.05.2011 10:57, schrieb Martin Taal:
>> Yeah the commit info handler :-)
>>
>> I have this in my activator:
>> final IManagedContainer container = IPluginContainer.INSTANCE;
>> final IRepository repo = CDOServerUtil.getRepository(container,
>> REPO_NAME);
>> final OutputStream os = new FileOutputStream(
>> "/home/mtaal/mytmp/test.commitinfo");
>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>
>> but then I get this:
>>
>>
>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>> !STACK 0
>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>> com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>> at java.lang.Thread.run(Thread.java:679)
>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>> at
>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>
>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>> ... 15 more
>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>> ... 19 more
>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>> bundle com.netxforge.netxstudio.server.
>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>> ... 31 more
>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>> org.eclipse.emf.cdo.server.repositories[default]
>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>> ... 37 more
>>
>>
>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>> Hi Eike,
>>>> The commit info
>>> commit info handler ;-)
>>>
>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>>> already be running
>>> No, these handlers can be added/removed at any time.
>>>
>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> gr. Martin
>>>>
>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>> Hi Eike,
>>>>>
>>>>> That's just great, thanks!
>>>>> Christophe
>>>>>
>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>> Hi Christophe,
>>>>>>
>>>>>> Please have a look at
>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>> handlers:
>>>>>>
>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>
>>>>>> They've been added with:
>>>>>>
>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>
>>>>>>> Thanks Christophe
>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687064 is a reply to message #687060] Thu, 26 May 2011 15:52 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 26.05.2011 12:15, schrieb Martin Taal:
> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a ping when a repository is up and running?
What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:

<extension point="org.eclipse.net4j.util.elementProcessors">
<elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
<elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
</extension>


IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



>
> gr. Martin
>
> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the time you
>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the container a
>> factory to create one. Can you post an executable example?
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>> Yeah the commit info handler :-)
>>>
>>> I have this in my activator:
>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>> REPO_NAME);
>>> final OutputStream os = new FileOutputStream(
>>> "/home/mtaal/mytmp/test.commitinfo");
>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>
>>> but then I get this:
>>>
>>>
>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>> !STACK 0
>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>> com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>> at java.lang.Thread.run(Thread.java:679)
>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>> at
>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>
>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>> ... 15 more
>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>> ... 19 more
>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>> bundle com.netxforge.netxstudio.server.
>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>> ... 31 more
>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>> org.eclipse.emf.cdo.server.repositories[default]
>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>> ... 37 more
>>>
>>>
>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>> Hi Eike,
>>>>> The commit info
>>>> commit info handler ;-)
>>>>
>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>>>> already be running
>>>> No, these handlers can be added/removed at any time.
>>>>
>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>> Hi Eike,
>>>>>>
>>>>>> That's just great, thanks!
>>>>>> Christophe
>>>>>>
>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>> Hi Christophe,
>>>>>>>
>>>>>>> Please have a look at
>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>> handlers:
>>>>>>>
>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>
>>>>>>> They've been added with:
>>>>>>>
>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>
>>>>>>>> Thanks Christophe
>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687065 is a reply to message #687064] Thu, 26 May 2011 16:07 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
If I use the element processor I get the same error, there is no repository when the elements gets parsed. For what
event should the listener be configured? Something like the repository-up-and-running event, is there something like that?

gr. Martin

On 05/26/2011 05:52 PM, Eike Stepper wrote:
> Am 26.05.2011 12:15, schrieb Martin Taal:
>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
>> ping when a repository is up and running?
> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>
> <extension point="org.eclipse.net4j.util.elementProcessors">
> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
> </extension>
>
>
> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
>>
>> gr. Martin
>>
>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the time you
>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the container a
>>> factory to create one. Can you post an executable example?
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>> Yeah the commit info handler :-)
>>>>
>>>> I have this in my activator:
>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>> REPO_NAME);
>>>> final OutputStream os = new FileOutputStream(
>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>
>>>> but then I get this:
>>>>
>>>>
>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>> !STACK 0
>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>> com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>> at java.lang.Thread.run(Thread.java:679)
>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>> at
>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>> at
>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>
>>>>
>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>> ... 15 more
>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>> at
>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>> ... 19 more
>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>> bundle com.netxforge.netxstudio.server.
>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>> ... 31 more
>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>> ... 37 more
>>>>
>>>>
>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>> Hi Eike,
>>>>>> The commit info
>>>>> commit info handler ;-)
>>>>>
>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>>>>> already be running
>>>>> No, these handlers can be added/removed at any time.
>>>>>
>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>> Hi Eike,
>>>>>>>
>>>>>>> That's just great, thanks!
>>>>>>> Christophe
>>>>>>>
>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>> Hi Christophe,
>>>>>>>>
>>>>>>>> Please have a look at
>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>> handlers:
>>>>>>>>
>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>
>>>>>>>> They've been added with:
>>>>>>>>
>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> /Eike
>>>>>>>>
>>>>>>>> ----
>>>>>>>> http://www.esc-net.de
>>>>>>>> http://thegordian.blogspot.com
>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>
>>>>>>>>> Thanks Christophe
>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687066 is a reply to message #687065] Thu, 26 May 2011 16:11 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 26.05.2011 18:07, schrieb Martin Taal:
> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
Can I see your process() method?

> For what event should the listener be configured?
IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.

> Something like the repository-up-and-running event, is there something like that?
Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a LifecycleEventAdapter.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
>>> ping when a repository is up and running?
>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>
>> <extension point="org.eclipse.net4j.util.elementProcessors">
>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>> </extension>
>>
>>
>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the time you
>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the container a
>>>> factory to create one. Can you post an executable example?
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>> Yeah the commit info handler :-)
>>>>>
>>>>> I have this in my activator:
>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>> REPO_NAME);
>>>>> final OutputStream os = new FileOutputStream(
>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>
>>>>> but then I get this:
>>>>>
>>>>>
>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>> !STACK 0
>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>> com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>> at
>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>> at
>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>
>>>>>
>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>> ... 15 more
>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>> at
>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>> ... 19 more
>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>> bundle com.netxforge.netxstudio.server.
>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>> ... 31 more
>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>> ... 37 more
>>>>>
>>>>>
>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>> Hi Eike,
>>>>>>> The commit info
>>>>>> commit info handler ;-)
>>>>>>
>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>>>>>> already be running
>>>>>> No, these handlers can be added/removed at any time.
>>>>>>
>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>> Hi Eike,
>>>>>>>>
>>>>>>>> That's just great, thanks!
>>>>>>>> Christophe
>>>>>>>>
>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>> Hi Christophe,
>>>>>>>>>
>>>>>>>>> Please have a look at
>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>> handlers:
>>>>>>>>>
>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>
>>>>>>>>> They've been added with:
>>>>>>>>>
>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike
>>>>>>>>>
>>>>>>>>> ----
>>>>>>>>> http://www.esc-net.de
>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>
>>>>>>>>>> Thanks Christophe
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687067 is a reply to message #687066] Thu, 26 May 2011 16:50 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
For the element processor, I should wait for a specific element type?

I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there. So
I should probably wait for a specific container event, which one?

IPluginContainer.INSTANCE.addListener(new IListener() {

@Override
public void notifyEvent(IEvent event) {
if (event instanceof IContainerEvent) {
final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
REPO_NAME);
final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
asyncCommitInfoHandler.activate();
repo.addCommitInfoHandler(asyncCommitInfoHandler);
}
}

});



On 05/26/2011 06:11 PM, Eike Stepper wrote:
> Am 26.05.2011 18:07, schrieb Martin Taal:
>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
> Can I see your process() method?
>
>> For what event should the listener be configured?
> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>
>> Something like the repository-up-and-running event, is there something like that?
> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
> LifecycleEventAdapter.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
>>>> ping when a repository is up and running?
>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>
>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>> </extension>
>>>
>>>
>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>>>
>>>> gr. Martin
>>>>
>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>> time you
>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>> container a
>>>>> factory to create one. Can you post an executable example?
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>
>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>> Yeah the commit info handler :-)
>>>>>>
>>>>>> I have this in my activator:
>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>> REPO_NAME);
>>>>>> final OutputStream os = new FileOutputStream(
>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>
>>>>>> but then I get this:
>>>>>>
>>>>>>
>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>> !STACK 0
>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>> at
>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>> at
>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>> ... 15 more
>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>> at
>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>> ... 19 more
>>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>> ... 31 more
>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>> ... 37 more
>>>>>>
>>>>>>
>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>> Hi Eike,
>>>>>>>> The commit info
>>>>>>> commit info handler ;-)
>>>>>>>
>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>>>>>>> already be running
>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>
>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> gr. Martin
>>>>>>>>
>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>> Hi Eike,
>>>>>>>>>
>>>>>>>>> That's just great, thanks!
>>>>>>>>> Christophe
>>>>>>>>>
>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>> Hi Christophe,
>>>>>>>>>>
>>>>>>>>>> Please have a look at
>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>> handlers:
>>>>>>>>>>
>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>
>>>>>>>>>> They've been added with:
>>>>>>>>>>
>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>
>>>>>>>>>> Cheers
>>>>>>>>>> /Eike
>>>>>>>>>>
>>>>>>>>>> ----
>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>
>>>>>>>>>>> Thanks Christophe
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687069 is a reply to message #687067] Thu, 26 May 2011 17:20 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Am 26.05.2011 18:50, schrieb Martin Taal:
<blockquote cite="mid:irlvsc$2h2$1@news.eclipse.org" type="cite">For
the element processor, I should wait for a specific element type?
<br>
</blockquote>
IRepository? :P<br>
<br>
I've tried to create an example for you:<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = -->
<!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3"
cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td nowrap="nowrap" align="left"
valign="top"> <code>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>class&nbsp;</b></font><font
color="#000000">RepositoryCommitLogConfigurer&nbsp;</font><font
color="#7f0055"><b>implements&nbsp;</b></font><font
color="#000000">IElementProcessor</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#000000">Object&nbsp;process</font><font
color="#000000">(</font><font color="#000000">IManagedContainer&nbsp;container,&nbsp;String&nbsp;productGroup,&nbsp;String&nbsp;factoryType,&nbsp;String&nbsp;description,</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Object&nbsp;element</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>if&nbsp;</b></font><font color="#000000">(</font><font
color="#000000">element&nbsp;</font><font color="#7f0055"><b>instanceof&nbsp;</b></font><font
color="#000000">IRepository</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>try</b></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">processRepository</font><font
color="#000000">((</font><font color="#000000">IRepository</font><font
color="#000000">)</font><font color="#000000">element</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>catch&nbsp;</b></font><font
color="#000000">(</font><font color="#000000">Exception&nbsp;ex</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">OM.LOG.warn</font><font
color="#000000">(</font><font color="#2a00ff">"Problem&nbsp;with&nbsp;commit&nbsp;log&nbsp;setup"</font><font
color="#000000">,&nbsp;ex</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>return&nbsp;</b></font><font
color="#000000">element;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>private&nbsp;</b></font><font
color="#7f0055"><b>void&nbsp;</b></font><font
color="#000000">processRepository</font><font
color="#000000">(</font><font color="#000000">IRepository&nbsp;repository</font><font
color="#000000">)&nbsp;</font><font color="#7f0055"><b>throws&nbsp;</b></font><font
color="#000000">FileNotFoundException</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>final&nbsp;</b></font><font
color="#000000">OutputStream&nbsp;os&nbsp;=&nbsp;</font><font
color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">FileOutputStream</font><font
color="#000000">(</font><font color="#2a00ff">"/home/mtaal/mytmp/test.commitinfo"</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">repository.addCommitInfoHandler</font><font
color="#000000">(</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">TextCommitInfoLog</font><font
color="#000000">(</font><font color="#000000">os</font><font
color="#000000">))</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">repository.addListener</font><font
color="#000000">(</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">LifecycleEventAdapter</font><font
color="#000000">()</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#646464">@Override</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>protected&nbsp;</b></font><font
color="#7f0055"><b>void&nbsp;</b></font><font
color="#000000">onDeactivated</font><font
color="#000000">(</font><font color="#000000">ILifecycle&nbsp;lifecycle</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">IOUtil.close</font><font
color="#000000">(</font><font color="#000000">os</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">})</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">IPluginContainer.INSTANCE.addPostProcessor</font><font
color="#000000">(</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">RepositoryCommitLogConfigurer</font><font
color="#000000">())</font><font color="#000000">;</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== -->
<br>
The last line can also be replaced with some markup in the
plugin.xml (see previous post).<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a><br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
<blockquote cite="mid:irlvsc$2h2$1@news.eclipse.org" type="cite">
<br>
I tried the listener, it fails the first time it gets called but
after a few calls the repository seems to be there. So I should
probably wait for a specific container event, which one?
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IPluginContainer.INSTANCE.addListener(new IListener() {
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @Override
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void notifyEvent(IEvent event) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (event instanceof IContainerEvent) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; final IContainer&lt;?&gt; container =
((IContainerEvent&lt;?&gt;)event).getSource();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; final IRepository repo =
CDOServerUtil.getRepository((IManagedContainer)container,
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REPO_NAME);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; final AsyncCommitInfoHandler
asyncCommitInfoHandler = new AsyncCommitInfoHandler(new
NetxForgeCommitInfoHandler());
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; asyncCommitInfoHandler.activate();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
repo.addCommitInfoHandler(asyncCommitInfoHandler);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });
<br>
<br>
<br>
<br>
On 05/26/2011 06:11 PM, Eike Stepper wrote:
<br>
<blockquote type="cite">Am 26.05.2011 18:07, schrieb Martin Taal:
<br>
<blockquote type="cite">If I use the element processor I get the
same error, there is no repository when the elements gets
parsed.
<br>
</blockquote>
Can I see your process() method?
<br>
<br>
<blockquote type="cite">For what event should the listener be
configured?
<br>
</blockquote>
IContainerEvent. You can also extend
org.eclipse.net4j.util.container.ContainerEventAdapter&lt;E&gt;.
<br>
<br>
<blockquote type="cite">Something like the
repository-up-and-running event, is there something like that?
<br>
</blockquote>
Yes, the repo fires ILifecycleEvents but you'd need to hold on
the repo before you can even register a
<br>
LifecycleEventAdapter.
<br>
<br>
Cheers
<br>
/Eike
<br>
<br>
----
<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a>
<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a>
<br>
<br>
<br>
<blockquote type="cite">
<br>
gr. Martin
<br>
<br>
On 05/26/2011 05:52 PM, Eike Stepper wrote:
<br>
<blockquote type="cite">Am 26.05.2011 12:15, schrieb Martin
Taal:
<br>
<blockquote type="cite">It is kind of difficult to create an
executable example, I put this code in the Activator of a
plugin. I can imagine
<br>
that this activator is called before the cdo repository is
up and running. Can I add a listener somehow which gets a
<br>
ping when a repository is up and running?
<br>
</blockquote>
What about
IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)?
You can also do it declaratively like:
<br>
<br>
&lt;extension
point="org.eclipse.net4j.util.elementProcessors"&gt;
<br>
&lt;elementProcessor
class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/&gt;<br>
&lt;elementProcessor
class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/&gt;<br>
&lt;/extension&gt;
<br>
<br>
<br>
IPluginContainer.INSTANCE.addListener(logConfigurer) should
also work because you don't need an early lifecycle phase.
<br>
<br>
Cheers
<br>
/Eike
<br>
<br>
----
<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a>
<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a>
<br>
<br>
<br>
<br>
<blockquote type="cite">
<br>
gr. Martin
<br>
<br>
On 05/26/2011 11:22 AM, Eike Stepper wrote:
<br>
<blockquote type="cite">I can't see how the exception is
related to the addition of the TextCommitInfoLog. To me
it seems as if, at the
<br>
time you
<br>
call CDOServerUtil.getRepository() there is neither a
repository with that name in the container nor has the
<br>
container a
<br>
factory to create one. Can you post an executable
example?
<br>
<br>
Cheers
<br>
/Eike
<br>
<br>
----
<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a>
<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a>
<br>
<br>
<br>
<br>
Am 26.05.2011 10:57, schrieb Martin Taal:
<br>
<blockquote type="cite">Yeah the commit info handler :-)
<br>
<br>
I have this in my activator:
<br>
final IManagedContainer container =
IPluginContainer.INSTANCE;
<br>
final IRepository repo =
CDOServerUtil.getRepository(container,
<br>
REPO_NAME);
<br>
final OutputStream os = new FileOutputStream(
<br>
"/home/mtaal/mytmp/test.commitinfo");
<br>
repo.addCommitInfoHandler(new TextCommitInfoLog(os));
<br>
<br>
but then I get this:
<br>
<br>
<br>
!ENTRY org.eclipse.equinox.app 4 0 2011-05-26
09:50:34.903
<br>
!MESSAGE org.eclipse.core.runtime.CoreException:
Plug-in com.netxforge.netxstudio.server was unable to
load class
<br>
com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
<br>
!STACK 0
<br>
org.eclipse.net4j.util.factory.FactoryCreationException:
org.eclipse.core.runtime.CoreException: Plug-in
<br>
com.netxforge.netxstudio.server was unable to load
class
<br>
com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
<br>
at
org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)<br>
at
org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)<br>
at
org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)<br>
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)<br>
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)<br>
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)<br>
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)<br>
at
org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)<br>
at
org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
<br>
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)<br>
at
org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)<br>
at java.lang.Thread.run(Thread.java:679)
<br>
Caused by: org.eclipse.core.runtime.CoreException:
Plug-in com.netxforge.netxstudio.server was unable to
load class
<br>
com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
<br>
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)<br>
at
<br>
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
<br>
at
org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)<br>
at
org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)<br>
at
<br>
org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
<br>
<br>
<br>
<br>
at
org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)<br>
... 15 more
<br>
Caused by:
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException:
An error
<br>
occurred while automatically activating bundle
com.netxforge.netxstudio.server (27).
<br>
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)<br>
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)<br>
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)<br>
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)<br>
at
java.lang.ClassLoader.loadClass(ClassLoader.java:266)
<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)<br>
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)<br>
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)<br>
at
<br>
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
<br>
... 19 more
<br>
Caused by: org.osgi.framework.BundleException:
Exception in
com.netxforge.netxstudio.server.Activator.start() of
<br>
bundle com.netxforge.netxstudio.server.
<br>
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)<br>
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)<br>
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)<br>
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)<br>
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)<br>
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)<br>
... 31 more
<br>
Caused by:
org.eclipse.net4j.util.container.FactoryNotFoundException:
Factory not found:
<br>
org.eclipse.emf.cdo.server.repositories[default]
<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)<br>
at
org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)<br>
at
org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)<br>
at
com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)<br>
at
com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
<br>
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)<br>
at java.security.AccessController.doPrivileged(Native
Method)
<br>
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)<br>
... 37 more
<br>
<br>
<br>
On 05/26/2011 10:18 AM, Eike Stepper wrote:
<br>
<blockquote type="cite">Am 26.05.2011 09:53, schrieb
Martin Taal:
<br>
<blockquote type="cite">Hi Eike,
<br>
The commit info
<br>
</blockquote>
commit info handler ;-)
<br>
<br>
<blockquote type="cite">needs to be added to the
repository programmatically. What is a good place
to do this? I mean the repository should
<br>
already be running
<br>
</blockquote>
No, these handlers can be added/removed at any time.
<br>
<br>
<blockquote type="cite">so it can't be done in some
Activator. Is there a logical place for these
repository configuration code?
<br>
</blockquote>
If you submit a bugzilla we could try to enhance the
RepositoryConfigurator that interprets the
cdo-server.xml
<br>
<br>
Cheers
<br>
/Eike
<br>
<br>
----
<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a>
<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a>
<br>
<br>
<br>
<blockquote type="cite">
<br>
gr. Martin
<br>
<br>
On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
<br>
<blockquote type="cite">Hi Eike,
<br>
<br>
That's just great, thanks!
<br>
Christophe
<br>
<br>
On 24-05-11 09:39, Eike Stepper wrote:
<br>
<blockquote type="cite">Hi Christophe,
<br>
<br>
Please have a look at
<br>
IRepository.addCommitInfoHandler(CDOCommitInfoHandler)
and these default
<br>
handlers:
<br>
<br>
org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
<br>
org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
<br>
org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
<br>
<br>
They've been added with:
<br>
<br>
333460: Would like to have all commit sets in
a log file
<br>
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460">https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460</a>
<br>
<br>
Cheers
<br>
/Eike
<br>
<br>
----
<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a>
<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a>
<br>
<br>
<br>
<br>
Am 24.05.2011 09:25, schrieb Christophe
Bouhier:
<br>
<blockquote type="cite">Hi, We have a
requirement to log activity per user. So
this could be
<br>
an object being created, modified or
deleted. It could also be a
<br>
reference being created, modified or
deleted. Is there a capability in
<br>
CDO to do this (Server side), perhaps
linking a CDOSession and CDOView ?
<br>
<br>
Thanks Christophe
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
<br>
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
</body>
</html>


Re: [CDO] logging of session/user activity. [message #687071 is a reply to message #687069] Thu, 26 May 2011 19:57 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.

gr. Martin

On 05/26/2011 07:20 PM, Eike Stepper wrote:
> Am 26.05.2011 18:50, schrieb Martin Taal:
>> For the element processor, I should wait for a specific element type?
> IRepository? :P
>
> I've tried to create an example for you:
>
> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
> {
> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
> Object element)
> {
> *if *(element *instanceof *IRepository)
> {
> *try*
> {
> processRepository((IRepository)element);
> }
> *catch *(Exception ex)
> {
> OM.LOG.warn("Problem with commit log setup", ex);
> }
> }
>
> *return *element;
> }
>
> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
> {
> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>
> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
> repository.addListener(*new *LifecycleEventAdapter()
> {
> @Override
> *protected **void *onDeactivated(ILifecycle lifecycle)
> {
> IOUtil.close(os);
> }
> });
> }
> }
>
> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>
>
> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>> So I should probably wait for a specific container event, which one?
>>
>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>
>> @Override
>> public void notifyEvent(IEvent event) {
>> if (event instanceof IContainerEvent) {
>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>> REPO_NAME);
>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>> asyncCommitInfoHandler.activate();
>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>> }
>> }
>>
>> });
>>
>>
>>
>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>> Can I see your process() method?
>>>
>>>> For what event should the listener be configured?
>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>
>>>> Something like the repository-up-and-running event, is there something like that?
>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>> LifecycleEventAdapter.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> gr. Martin
>>>>
>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
>>>>>> ping when a repository is up and running?
>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>
>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>> </extension>
>>>>>
>>>>>
>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>> time you
>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>> container a
>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>
>>>>>>>> I have this in my activator:
>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>> REPO_NAME);
>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>
>>>>>>>> but then I get this:
>>>>>>>>
>>>>>>>>
>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>> !STACK 0
>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>> at
>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>
>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>> at
>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>> ... 15 more
>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>> at
>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>
>>>>>>>> ... 19 more
>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>> ... 31 more
>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>> ... 37 more
>>>>>>>>
>>>>>>>>
>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>> Hi Eike,
>>>>>>>>>> The commit info
>>>>>>>>> commit info handler ;-)
>>>>>>>>>
>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>> should
>>>>>>>>>> already be running
>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>
>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike
>>>>>>>>>
>>>>>>>>> ----
>>>>>>>>> http://www.esc-net.de
>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> gr. Martin
>>>>>>>>>>
>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>
>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>> Christophe
>>>>>>>>>>>
>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>
>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>> handlers:
>>>>>>>>>>>>
>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>
>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>
>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>
>>>>>>>>>>>> Cheers
>>>>>>>>>>>> /Eike
>>>>>>>>>>>>
>>>>>>>>>>>> ----
>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687072 is a reply to message #687071] Thu, 26 May 2011 20:50 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 26.05.2011 21:57, schrieb Martin Taal:
> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
If I can't try it I run out of ideas ;-(

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>> For the element processor, I should wait for a specific element type?
>> IRepository? :P
>>
>> I've tried to create an example for you:
>>
>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>> {
>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>> Object element)
>> {
>> *if *(element *instanceof *IRepository)
>> {
>> *try*
>> {
>> processRepository((IRepository)element);
>> }
>> *catch *(Exception ex)
>> {
>> OM.LOG.warn("Problem with commit log setup", ex);
>> }
>> }
>>
>> *return *element;
>> }
>>
>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>> {
>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>
>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>> repository.addListener(*new *LifecycleEventAdapter()
>> {
>> @Override
>> *protected **void *onDeactivated(ILifecycle lifecycle)
>> {
>> IOUtil.close(os);
>> }
>> });
>> }
>> }
>>
>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>
>>
>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>>> So I should probably wait for a specific container event, which one?
>>>
>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>
>>> @Override
>>> public void notifyEvent(IEvent event) {
>>> if (event instanceof IContainerEvent) {
>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>> REPO_NAME);
>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>> asyncCommitInfoHandler.activate();
>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>> }
>>> }
>>>
>>> });
>>>
>>>
>>>
>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>> Can I see your process() method?
>>>>
>>>>> For what event should the listener be configured?
>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>
>>>>> Something like the repository-up-and-running event, is there something like that?
>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>> LifecycleEventAdapter.
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
>>>>>>> ping when a repository is up and running?
>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>
>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>> </extension>
>>>>>>
>>>>>>
>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>>> time you
>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>> container a
>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> /Eike
>>>>>>>>
>>>>>>>> ----
>>>>>>>> http://www.esc-net.de
>>>>>>>> http://thegordian.blogspot.com
>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>
>>>>>>>>> I have this in my activator:
>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>> REPO_NAME);
>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>
>>>>>>>>> but then I get this:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>> !STACK 0
>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>> at
>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>
>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>> at
>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>> ... 15 more
>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>> at
>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>
>>>>>>>>> ... 19 more
>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>> ... 31 more
>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>> ... 37 more
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>> Hi Eike,
>>>>>>>>>>> The commit info
>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>
>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>>> should
>>>>>>>>>>> already be running
>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>
>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>>
>>>>>>>>>> Cheers
>>>>>>>>>> /Eike
>>>>>>>>>>
>>>>>>>>>> ----
>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> gr. Martin
>>>>>>>>>>>
>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>
>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>> Christophe
>>>>>>>>>>>>
>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>
>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>
>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>
>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>
>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>
>>>>>>>>>>>>> ----
>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687073 is a reply to message #687072] Thu, 26 May 2011 20:55 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Eike,
You mean that in your case this element processor gets a Repository instance?

gr. Martin

On 05/26/2011 10:50 PM, Eike Stepper wrote:
> Am 26.05.2011 21:57, schrieb Martin Taal:
>> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
> If I can't try it I run out of ideas ;-(
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>>> For the element processor, I should wait for a specific element type?
>>> IRepository? :P
>>>
>>> I've tried to create an example for you:
>>>
>>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>>> {
>>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>>> Object element)
>>> {
>>> *if *(element *instanceof *IRepository)
>>> {
>>> *try*
>>> {
>>> processRepository((IRepository)element);
>>> }
>>> *catch *(Exception ex)
>>> {
>>> OM.LOG.warn("Problem with commit log setup", ex);
>>> }
>>> }
>>>
>>> *return *element;
>>> }
>>>
>>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>>> {
>>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>>
>>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>>> repository.addListener(*new *LifecycleEventAdapter()
>>> {
>>> @Override
>>> *protected **void *onDeactivated(ILifecycle lifecycle)
>>> {
>>> IOUtil.close(os);
>>> }
>>> });
>>> }
>>> }
>>>
>>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>>
>>>
>>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>>>> So I should probably wait for a specific container event, which one?
>>>>
>>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>>
>>>> @Override
>>>> public void notifyEvent(IEvent event) {
>>>> if (event instanceof IContainerEvent) {
>>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>>> REPO_NAME);
>>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>>> asyncCommitInfoHandler.activate();
>>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>>> }
>>>> }
>>>>
>>>> });
>>>>
>>>>
>>>>
>>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>>> Can I see your process() method?
>>>>>
>>>>>> For what event should the listener be configured?
>>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>>
>>>>>> Something like the repository-up-and-running event, is there something like that?
>>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>>> LifecycleEventAdapter.
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can
>>>>>>>> imagine
>>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which
>>>>>>>> gets a
>>>>>>>> ping when a repository is up and running?
>>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>>
>>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>>> </extension>
>>>>>>>
>>>>>>>
>>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle
>>>>>>> phase.
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> gr. Martin
>>>>>>>>
>>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>>>> time you
>>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>>> container a
>>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike
>>>>>>>>>
>>>>>>>>> ----
>>>>>>>>> http://www.esc-net.de
>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>>
>>>>>>>>>> I have this in my activator:
>>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>>> REPO_NAME);
>>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>>
>>>>>>>>>> but then I get this:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>> !STACK 0
>>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>> class
>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>>> ... 15 more
>>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An
>>>>>>>>>> error
>>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ... 19 more
>>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>>> ... 31 more
>>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>>> ... 37 more
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>> The commit info
>>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>>
>>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>>>> should
>>>>>>>>>>>> already be running
>>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>>
>>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>>>
>>>>>>>>>>> Cheers
>>>>>>>>>>> /Eike
>>>>>>>>>>>
>>>>>>>>>>> ----
>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>
>>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>
>>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>>> Christophe
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687075 is a reply to message #687073] Fri, 27 May 2011 06:13 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 26.05.2011 22:55, schrieb Martin Taal:
> Hi Eike,
> You mean that in your case this element processor gets a Repository instance?
No, that means that I did not run my code. It all depends on if/how/when the repository is created and if/how/when it is made available in the container. There are thousand ways possible.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 05/26/2011 10:50 PM, Eike Stepper wrote:
>> Am 26.05.2011 21:57, schrieb Martin Taal:
>>> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
>> If I can't try it I run out of ideas ;-(
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>>>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>>>> For the element processor, I should wait for a specific element type?
>>>> IRepository? :P
>>>>
>>>> I've tried to create an example for you:
>>>>
>>>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>>>> {
>>>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>>>> Object element)
>>>> {
>>>> *if *(element *instanceof *IRepository)
>>>> {
>>>> *try*
>>>> {
>>>> processRepository((IRepository)element);
>>>> }
>>>> *catch *(Exception ex)
>>>> {
>>>> OM.LOG.warn("Problem with commit log setup", ex);
>>>> }
>>>> }
>>>>
>>>> *return *element;
>>>> }
>>>>
>>>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>>>> {
>>>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>>>
>>>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>>>> repository.addListener(*new *LifecycleEventAdapter()
>>>> {
>>>> @Override
>>>> *protected **void *onDeactivated(ILifecycle lifecycle)
>>>> {
>>>> IOUtil.close(os);
>>>> }
>>>> });
>>>> }
>>>> }
>>>>
>>>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>>>
>>>>
>>>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>>
>>>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>>>>> So I should probably wait for a specific container event, which one?
>>>>>
>>>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>>>
>>>>> @Override
>>>>> public void notifyEvent(IEvent event) {
>>>>> if (event instanceof IContainerEvent) {
>>>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>>>> REPO_NAME);
>>>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>>>> asyncCommitInfoHandler.activate();
>>>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>>>> }
>>>>> }
>>>>>
>>>>> });
>>>>>
>>>>>
>>>>>
>>>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>>>> Can I see your process() method?
>>>>>>
>>>>>>> For what event should the listener be configured?
>>>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>>>
>>>>>>> Something like the repository-up-and-running event, is there something like that?
>>>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>>>> LifecycleEventAdapter.
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can
>>>>>>>>> imagine
>>>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which
>>>>>>>>> gets a
>>>>>>>>> ping when a repository is up and running?
>>>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>>>
>>>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>>>> </extension>
>>>>>>>>
>>>>>>>>
>>>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle
>>>>>>>> phase.
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> /Eike
>>>>>>>>
>>>>>>>> ----
>>>>>>>> http://www.esc-net.de
>>>>>>>> http://thegordian.blogspot.com
>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> gr. Martin
>>>>>>>>>
>>>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>>>>> time you
>>>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>>>> container a
>>>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>>>
>>>>>>>>>> Cheers
>>>>>>>>>> /Eike
>>>>>>>>>>
>>>>>>>>>> ----
>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>>>
>>>>>>>>>>> I have this in my activator:
>>>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>>>> REPO_NAME);
>>>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>>>
>>>>>>>>>>> but then I get this:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>> !STACK 0
>>>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>> class
>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>>>> at
>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>>>> at
>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>>>> at
>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>>>> ... 15 more
>>>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An
>>>>>>>>>>> error
>>>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>>>> at
>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ... 19 more
>>>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>>>> ... 31 more
>>>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>>>> ... 37 more
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>> The commit info
>>>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>>>
>>>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>>>>> should
>>>>>>>>>>>>> already be running
>>>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>>>
>>>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>>>>
>>>>>>>>>>>> Cheers
>>>>>>>>>>>> /Eike
>>>>>>>>>>>>
>>>>>>>>>>>> ----
>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>>>> Christophe
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687079 is a reply to message #687075] Fri, 27 May 2011 09:16 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Eike,
I use the cdo-server.xml which I attached. Does this help?

gr. Martin

On 05/27/2011 08:13 AM, Eike Stepper wrote:
> Am 26.05.2011 22:55, schrieb Martin Taal:
>> Hi Eike,
>> You mean that in your case this element processor gets a Repository instance?
> No, that means that I did not run my code. It all depends on if/how/when the repository is created and if/how/when it is
> made available in the container. There are thousand ways possible.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 05/26/2011 10:50 PM, Eike Stepper wrote:
>>> Am 26.05.2011 21:57, schrieb Martin Taal:
>>>> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
>>> If I can't try it I run out of ideas ;-(
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> gr. Martin
>>>>
>>>> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>>>>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>>>>> For the element processor, I should wait for a specific element type?
>>>>> IRepository? :P
>>>>>
>>>>> I've tried to create an example for you:
>>>>>
>>>>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>>>>> {
>>>>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>>>>> Object element)
>>>>> {
>>>>> *if *(element *instanceof *IRepository)
>>>>> {
>>>>> *try*
>>>>> {
>>>>> processRepository((IRepository)element);
>>>>> }
>>>>> *catch *(Exception ex)
>>>>> {
>>>>> OM.LOG.warn("Problem with commit log setup", ex);
>>>>> }
>>>>> }
>>>>>
>>>>> *return *element;
>>>>> }
>>>>>
>>>>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>>>>> {
>>>>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>>>>
>>>>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>>>>> repository.addListener(*new *LifecycleEventAdapter()
>>>>> {
>>>>> @Override
>>>>> *protected **void *onDeactivated(ILifecycle lifecycle)
>>>>> {
>>>>> IOUtil.close(os);
>>>>> }
>>>>> });
>>>>> }
>>>>> }
>>>>>
>>>>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>>>>
>>>>>
>>>>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>>
>>>>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>>>>>> So I should probably wait for a specific container event, which one?
>>>>>>
>>>>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>>>>
>>>>>> @Override
>>>>>> public void notifyEvent(IEvent event) {
>>>>>> if (event instanceof IContainerEvent) {
>>>>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>>>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>>>>> REPO_NAME);
>>>>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>>>>> asyncCommitInfoHandler.activate();
>>>>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> });
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>>>>> Can I see your process() method?
>>>>>>>
>>>>>>>> For what event should the listener be configured?
>>>>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>>>>
>>>>>>>> Something like the repository-up-and-running event, is there something like that?
>>>>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>>>>> LifecycleEventAdapter.
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> gr. Martin
>>>>>>>>
>>>>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can
>>>>>>>>>> imagine
>>>>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which
>>>>>>>>>> gets a
>>>>>>>>>> ping when a repository is up and running?
>>>>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>>>>
>>>>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>>>>> </extension>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle
>>>>>>>>> phase.
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike
>>>>>>>>>
>>>>>>>>> ----
>>>>>>>>> http://www.esc-net.de
>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> gr. Martin
>>>>>>>>>>
>>>>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>>>>>> time you
>>>>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>>>>> container a
>>>>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>>>>
>>>>>>>>>>> Cheers
>>>>>>>>>>> /Eike
>>>>>>>>>>>
>>>>>>>>>>> ----
>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>>>>
>>>>>>>>>>>> I have this in my activator:
>>>>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>>>>> REPO_NAME);
>>>>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>>>>
>>>>>>>>>>>> but then I get this:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>> class
>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>> !STACK 0
>>>>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>> class
>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>>>>> at
>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>>>>> at
>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>>>>>
>>>>>>>>>>>> at
>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>>>>> ... 15 more
>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An
>>>>>>>>>>>> error
>>>>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>>>>> at
>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ... 19 more
>>>>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in
>>>>>>>>>>>> com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>>>>> ... 31 more
>>>>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>>>>> ... 37 more
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>> The commit info
>>>>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>>>>
>>>>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>>>>>> should
>>>>>>>>>>>>>> already be running
>>>>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>>>>
>>>>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>>>>>
>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>
>>>>>>>>>>>>> ----
>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>>>>> Christophe
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687080 is a reply to message #687079] Fri, 27 May 2011 10:02 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Hi Martin,

Sorry, I realized a little late that there's an issue with ManagedContainer.putElement() in that does not call element processors. I've fixed that in bugzilla:

347427: ManagedContainer.putElement() does not call element processors
https://bugs.eclipse.org/bugs/show_bug.cgi?id=347427

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 27.05.2011 11:16, schrieb Martin Taal:
> Hi Eike,
> I use the cdo-server.xml which I attached. Does this help?
>
> gr. Martin
>
> On 05/27/2011 08:13 AM, Eike Stepper wrote:
>> Am 26.05.2011 22:55, schrieb Martin Taal:
>>> Hi Eike,
>>> You mean that in your case this element processor gets a Repository instance?
>> No, that means that I did not run my code. It all depends on if/how/when the repository is created and if/how/when it is
>> made available in the container. There are thousand ways possible.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 05/26/2011 10:50 PM, Eike Stepper wrote:
>>>> Am 26.05.2011 21:57, schrieb Martin Taal:
>>>>> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
>>>> If I can't try it I run out of ideas ;-(
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>>>>>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>>>>>> For the element processor, I should wait for a specific element type?
>>>>>> IRepository? :P
>>>>>>
>>>>>> I've tried to create an example for you:
>>>>>>
>>>>>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>>>>>> {
>>>>>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>>>>>> Object element)
>>>>>> {
>>>>>> *if *(element *instanceof *IRepository)
>>>>>> {
>>>>>> *try*
>>>>>> {
>>>>>> processRepository((IRepository)element);
>>>>>> }
>>>>>> *catch *(Exception ex)
>>>>>> {
>>>>>> OM.LOG.warn("Problem with commit log setup", ex);
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> *return *element;
>>>>>> }
>>>>>>
>>>>>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>>>>>> {
>>>>>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>>>>>
>>>>>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>>>>>> repository.addListener(*new *LifecycleEventAdapter()
>>>>>> {
>>>>>> @Override
>>>>>> *protected **void *onDeactivated(ILifecycle lifecycle)
>>>>>> {
>>>>>> IOUtil.close(os);
>>>>>> }
>>>>>> });
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>>>>>
>>>>>>
>>>>>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>>>>>>> So I should probably wait for a specific container event, which one?
>>>>>>>
>>>>>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>>>>>
>>>>>>> @Override
>>>>>>> public void notifyEvent(IEvent event) {
>>>>>>> if (event instanceof IContainerEvent) {
>>>>>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>>>>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>>>>>> REPO_NAME);
>>>>>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>>>>>> asyncCommitInfoHandler.activate();
>>>>>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> });
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>>>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>>>>>> Can I see your process() method?
>>>>>>>>
>>>>>>>>> For what event should the listener be configured?
>>>>>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>>>>>
>>>>>>>>> Something like the repository-up-and-running event, is there something like that?
>>>>>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>>>>>> LifecycleEventAdapter.
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> /Eike
>>>>>>>>
>>>>>>>> ----
>>>>>>>> http://www.esc-net.de
>>>>>>>> http://thegordian.blogspot.com
>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> gr. Martin
>>>>>>>>>
>>>>>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can
>>>>>>>>>>> imagine
>>>>>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which
>>>>>>>>>>> gets a
>>>>>>>>>>> ping when a repository is up and running?
>>>>>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>>>>>
>>>>>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>>>>>> </extension>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle
>>>>>>>>>> phase.
>>>>>>>>>>
>>>>>>>>>> Cheers
>>>>>>>>>> /Eike
>>>>>>>>>>
>>>>>>>>>> ----
>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> gr. Martin
>>>>>>>>>>>
>>>>>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>>>>>>> time you
>>>>>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>>>>>> container a
>>>>>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>>>>>
>>>>>>>>>>>> Cheers
>>>>>>>>>>>> /Eike
>>>>>>>>>>>>
>>>>>>>>>>>> ----
>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>>>>>
>>>>>>>>>>>>> I have this in my activator:
>>>>>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>>>>>> REPO_NAME);
>>>>>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>>>>>
>>>>>>>>>>>>> but then I get this:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>>> class
>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>> !STACK 0
>>>>>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>>> class
>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>>>>>> ... 15 more
>>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An
>>>>>>>>>>>>> error
>>>>>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ... 19 more
>>>>>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in
>>>>>>>>>>>>> com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>>>>>> ... 31 more
>>>>>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>>>>>> ... 37 more
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>> The commit info
>>>>>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>> already be running
>>>>>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>>>>>> Christophe
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687081 is a reply to message #687080] Fri, 27 May 2011 10:41 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Thanks Eike, I will pick up the build which contains this and try it out.

gr. Martin

On 05/27/2011 12:02 PM, Eike Stepper wrote:
> Hi Martin,
>
> Sorry, I realized a little late that there's an issue with ManagedContainer.putElement() in that does not call element
> processors. I've fixed that in bugzilla:
>
> 347427: ManagedContainer.putElement() does not call element processors
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=347427
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 27.05.2011 11:16, schrieb Martin Taal:
>> Hi Eike,
>> I use the cdo-server.xml which I attached. Does this help?
>>
>> gr. Martin
>>
>> On 05/27/2011 08:13 AM, Eike Stepper wrote:
>>> Am 26.05.2011 22:55, schrieb Martin Taal:
>>>> Hi Eike,
>>>> You mean that in your case this element processor gets a Repository instance?
>>> No, that means that I did not run my code. It all depends on if/how/when the repository is created and if/how/when it is
>>> made available in the container. There are thousand ways possible.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> gr. Martin
>>>>
>>>> On 05/26/2011 10:50 PM, Eike Stepper wrote:
>>>>> Am 26.05.2011 21:57, schrieb Martin Taal:
>>>>>> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
>>>>> If I can't try it I run out of ideas ;-(
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>>>>>>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>>>>>>> For the element processor, I should wait for a specific element type?
>>>>>>> IRepository? :P
>>>>>>>
>>>>>>> I've tried to create an example for you:
>>>>>>>
>>>>>>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>>>>>>> {
>>>>>>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>>>>>>> Object element)
>>>>>>> {
>>>>>>> *if *(element *instanceof *IRepository)
>>>>>>> {
>>>>>>> *try*
>>>>>>> {
>>>>>>> processRepository((IRepository)element);
>>>>>>> }
>>>>>>> *catch *(Exception ex)
>>>>>>> {
>>>>>>> OM.LOG.warn("Problem with commit log setup", ex);
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> *return *element;
>>>>>>> }
>>>>>>>
>>>>>>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>>>>>>> {
>>>>>>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>>>>>>
>>>>>>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>>>>>>> repository.addListener(*new *LifecycleEventAdapter()
>>>>>>> {
>>>>>>> @Override
>>>>>>> *protected **void *onDeactivated(ILifecycle lifecycle)
>>>>>>> {
>>>>>>> IOUtil.close(os);
>>>>>>> }
>>>>>>> });
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>>>>>>
>>>>>>>
>>>>>>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be
>>>>>>>> there.
>>>>>>>> So I should probably wait for a specific container event, which one?
>>>>>>>>
>>>>>>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>>>>>>
>>>>>>>> @Override
>>>>>>>> public void notifyEvent(IEvent event) {
>>>>>>>> if (event instanceof IContainerEvent) {
>>>>>>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>>>>>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>>>>>>> REPO_NAME);
>>>>>>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>>>>>>> asyncCommitInfoHandler.activate();
>>>>>>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>>>>>>> }
>>>>>>>> }
>>>>>>>>
>>>>>>>> });
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>>>>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>>>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>>>>>>> Can I see your process() method?
>>>>>>>>>
>>>>>>>>>> For what event should the listener be configured?
>>>>>>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>>>>>>
>>>>>>>>>> Something like the repository-up-and-running event, is there something like that?
>>>>>>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>>>>>>> LifecycleEventAdapter.
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike
>>>>>>>>>
>>>>>>>>> ----
>>>>>>>>> http://www.esc-net.de
>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> gr. Martin
>>>>>>>>>>
>>>>>>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can
>>>>>>>>>>>> imagine
>>>>>>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which
>>>>>>>>>>>> gets a
>>>>>>>>>>>> ping when a repository is up and running?
>>>>>>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>>>>>>
>>>>>>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>>>>>>> </extension>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle
>>>>>>>>>>> phase.
>>>>>>>>>>>
>>>>>>>>>>> Cheers
>>>>>>>>>>> /Eike
>>>>>>>>>>>
>>>>>>>>>>> ----
>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>
>>>>>>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at
>>>>>>>>>>>>> the
>>>>>>>>>>>>> time you
>>>>>>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>>>>>>> container a
>>>>>>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>
>>>>>>>>>>>>> ----
>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I have this in my activator:
>>>>>>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>>>>>>> REPO_NAME);
>>>>>>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> but then I get this:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>>>> class
>>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>>> !STACK 0
>>>>>>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>>>> class
>>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>>>>>>> ... 15 more
>>>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An
>>>>>>>>>>>>>> error
>>>>>>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ... 19 more
>>>>>>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in
>>>>>>>>>>>>>> com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>>>>>>> ... 31 more
>>>>>>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>>>>>>> ... 37 more
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>>> The commit info
>>>>>>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the
>>>>>>>>>>>>>>>> repository
>>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>>> already be running
>>>>>>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the
>>>>>>>>>>>>>>> cdo-server.xml
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>>>>>>> Christophe
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687234 is a reply to message #687036] Tue, 24 May 2011 07:49 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi Eike,

That's just great, thanks!
Christophe

On 24-05-11 09:39, Eike Stepper wrote:
> Hi Christophe,
>
> Please have a look at
> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
> handlers:
>
> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>
> They've been added with:
>
> 333460: Would like to have all commit sets in a log file
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>> Hi, We have a requirement to log activity per user. So this could be
>> an object being created, modified or deleted. It could also be a
>> reference being created, modified or deleted. Is there a capability in
>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>
>> Thanks Christophe
Re: [CDO] logging of session/user activity. [message #687260 is a reply to message #687037] Thu, 26 May 2011 07:53 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Eike,
The commit info needs to be added to the repository programmatically. What is a good place to do this? I mean the
repository should already be running so it can't be done in some Activator. Is there a logical place for these
repository configuration code?

gr. Martin

On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
> Hi Eike,
>
> That's just great, thanks!
> Christophe
>
> On 24-05-11 09:39, Eike Stepper wrote:
>> Hi Christophe,
>>
>> Please have a look at
>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>> handlers:
>>
>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>
>> They've been added with:
>>
>> 333460: Would like to have all commit sets in a log file
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>> Hi, We have a requirement to log activity per user. So this could be
>>> an object being created, modified or deleted. It could also be a
>>> reference being created, modified or deleted. Is there a capability in
>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>
>>> Thanks Christophe
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687261 is a reply to message #687055] Thu, 26 May 2011 08:18 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 26.05.2011 09:53, schrieb Martin Taal:
> Hi Eike,
> The commit info
commit info handler ;-)

> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should already be running
No, these handlers can be added/removed at any time.

> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>> Hi Eike,
>>
>> That's just great, thanks!
>> Christophe
>>
>> On 24-05-11 09:39, Eike Stepper wrote:
>>> Hi Christophe,
>>>
>>> Please have a look at
>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>> handlers:
>>>
>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>
>>> They've been added with:
>>>
>>> 333460: Would like to have all commit sets in a log file
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>> Hi, We have a requirement to log activity per user. So this could be
>>>> an object being created, modified or deleted. It could also be a
>>>> reference being created, modified or deleted. Is there a capability in
>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>
>>>> Thanks Christophe
>>
>
>


Re: [CDO] logging of session/user activity. [message #687262 is a reply to message #687056] Thu, 26 May 2011 08:57 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Yeah the commit info handler :-)

I have this in my activator:
final IManagedContainer container = IPluginContainer.INSTANCE;
final IRepository repo = CDOServerUtil.getRepository(container,
REPO_NAME);
final OutputStream os = new FileOutputStream(
"/home/mtaal/mytmp/test.commitinfo");
repo.addCommitInfoHandler(new TextCommitInfoLog(os));

but then I get this:


!ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
!MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
!STACK 0
org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
at java.lang.Thread.run(Thread.java:679)
Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
... 15 more
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
... 19 more
Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of bundle
com.netxforge.netxstudio.server.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
... 31 more
Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
org.eclipse.emf.cdo.server.repositories[default]
at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
... 37 more


On 05/26/2011 10:18 AM, Eike Stepper wrote:
> Am 26.05.2011 09:53, schrieb Martin Taal:
>> Hi Eike,
>> The commit info
> commit info handler ;-)
>
>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>> already be running
> No, these handlers can be added/removed at any time.
>
>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>> Hi Eike,
>>>
>>> That's just great, thanks!
>>> Christophe
>>>
>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>> Hi Christophe,
>>>>
>>>> Please have a look at
>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>> handlers:
>>>>
>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>
>>>> They've been added with:
>>>>
>>>> 333460: Would like to have all commit sets in a log file
>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>> an object being created, modified or deleted. It could also be a
>>>>> reference being created, modified or deleted. Is there a capability in
>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>
>>>>> Thanks Christophe
>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687264 is a reply to message #687057] Thu, 26 May 2011 09:22 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the time you call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the container a factory to create one. Can you post an executable example?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 26.05.2011 10:57, schrieb Martin Taal:
> Yeah the commit info handler :-)
>
> I have this in my activator:
> final IManagedContainer container = IPluginContainer.INSTANCE;
> final IRepository repo = CDOServerUtil.getRepository(container,
> REPO_NAME);
> final OutputStream os = new FileOutputStream(
> "/home/mtaal/mytmp/test.commitinfo");
> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>
> but then I get this:
>
>
> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
> !STACK 0
> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
> at java.lang.Thread.run(Thread.java:679)
> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
> at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
> ... 15 more
> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
> ... 19 more
> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of bundle com.netxforge.netxstudio.server.
> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
> ... 31 more
> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found: org.eclipse.emf.cdo.server.repositories[default]
> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
> at java.security.AccessController.doPrivileged(Native Method)
> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
> ... 37 more
>
>
> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>> Hi Eike,
>>> The commit info
>> commit info handler ;-)
>>
>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>> already be running
>> No, these handlers can be added/removed at any time.
>>
>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>> Hi Eike,
>>>>
>>>> That's just great, thanks!
>>>> Christophe
>>>>
>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>> Hi Christophe,
>>>>>
>>>>> Please have a look at
>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>> handlers:
>>>>>
>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>
>>>>> They've been added with:
>>>>>
>>>>> 333460: Would like to have all commit sets in a log file
>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>
>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>> an object being created, modified or deleted. It could also be a
>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>
>>>>>> Thanks Christophe
>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687265 is a reply to message #687059] Thu, 26 May 2011 10:15 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
ping when a repository is up and running?

gr. Martin

On 05/26/2011 11:22 AM, Eike Stepper wrote:
> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the time you
> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the container a
> factory to create one. Can you post an executable example?
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 26.05.2011 10:57, schrieb Martin Taal:
>> Yeah the commit info handler :-)
>>
>> I have this in my activator:
>> final IManagedContainer container = IPluginContainer.INSTANCE;
>> final IRepository repo = CDOServerUtil.getRepository(container,
>> REPO_NAME);
>> final OutputStream os = new FileOutputStream(
>> "/home/mtaal/mytmp/test.commitinfo");
>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>
>> but then I get this:
>>
>>
>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>> !STACK 0
>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>> com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>> at java.lang.Thread.run(Thread.java:679)
>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>> at
>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>
>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>> ... 15 more
>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>> ... 19 more
>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>> bundle com.netxforge.netxstudio.server.
>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>> ... 31 more
>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>> org.eclipse.emf.cdo.server.repositories[default]
>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>> ... 37 more
>>
>>
>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>> Hi Eike,
>>>> The commit info
>>> commit info handler ;-)
>>>
>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>>> already be running
>>> No, these handlers can be added/removed at any time.
>>>
>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> gr. Martin
>>>>
>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>> Hi Eike,
>>>>>
>>>>> That's just great, thanks!
>>>>> Christophe
>>>>>
>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>> Hi Christophe,
>>>>>>
>>>>>> Please have a look at
>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>> handlers:
>>>>>>
>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>
>>>>>> They've been added with:
>>>>>>
>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>
>>>>>>> Thanks Christophe
>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687272 is a reply to message #687060] Thu, 26 May 2011 15:52 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 26.05.2011 12:15, schrieb Martin Taal:
> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a ping when a repository is up and running?
What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:

<extension point="org.eclipse.net4j.util.elementProcessors">
<elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
<elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
</extension>


IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



>
> gr. Martin
>
> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the time you
>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the container a
>> factory to create one. Can you post an executable example?
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>> Yeah the commit info handler :-)
>>>
>>> I have this in my activator:
>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>> REPO_NAME);
>>> final OutputStream os = new FileOutputStream(
>>> "/home/mtaal/mytmp/test.commitinfo");
>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>
>>> but then I get this:
>>>
>>>
>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>> !STACK 0
>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>> com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>> at java.lang.Thread.run(Thread.java:679)
>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>> at
>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>
>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>> ... 15 more
>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>> ... 19 more
>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>> bundle com.netxforge.netxstudio.server.
>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>> ... 31 more
>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>> org.eclipse.emf.cdo.server.repositories[default]
>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>> ... 37 more
>>>
>>>
>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>> Hi Eike,
>>>>> The commit info
>>>> commit info handler ;-)
>>>>
>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>>>> already be running
>>>> No, these handlers can be added/removed at any time.
>>>>
>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>> Hi Eike,
>>>>>>
>>>>>> That's just great, thanks!
>>>>>> Christophe
>>>>>>
>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>> Hi Christophe,
>>>>>>>
>>>>>>> Please have a look at
>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>> handlers:
>>>>>>>
>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>
>>>>>>> They've been added with:
>>>>>>>
>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>
>>>>>>>> Thanks Christophe
>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687273 is a reply to message #687064] Thu, 26 May 2011 16:07 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
If I use the element processor I get the same error, there is no repository when the elements gets parsed. For what
event should the listener be configured? Something like the repository-up-and-running event, is there something like that?

gr. Martin

On 05/26/2011 05:52 PM, Eike Stepper wrote:
> Am 26.05.2011 12:15, schrieb Martin Taal:
>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
>> ping when a repository is up and running?
> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>
> <extension point="org.eclipse.net4j.util.elementProcessors">
> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
> </extension>
>
>
> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
>>
>> gr. Martin
>>
>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the time you
>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the container a
>>> factory to create one. Can you post an executable example?
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>> Yeah the commit info handler :-)
>>>>
>>>> I have this in my activator:
>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>> REPO_NAME);
>>>> final OutputStream os = new FileOutputStream(
>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>
>>>> but then I get this:
>>>>
>>>>
>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>> !STACK 0
>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>> com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>> at java.lang.Thread.run(Thread.java:679)
>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>> at
>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>> at
>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>
>>>>
>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>> ... 15 more
>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>> at
>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>> ... 19 more
>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>> bundle com.netxforge.netxstudio.server.
>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>> ... 31 more
>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>> ... 37 more
>>>>
>>>>
>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>> Hi Eike,
>>>>>> The commit info
>>>>> commit info handler ;-)
>>>>>
>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>>>>> already be running
>>>>> No, these handlers can be added/removed at any time.
>>>>>
>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>> Hi Eike,
>>>>>>>
>>>>>>> That's just great, thanks!
>>>>>>> Christophe
>>>>>>>
>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>> Hi Christophe,
>>>>>>>>
>>>>>>>> Please have a look at
>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>> handlers:
>>>>>>>>
>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>
>>>>>>>> They've been added with:
>>>>>>>>
>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> /Eike
>>>>>>>>
>>>>>>>> ----
>>>>>>>> http://www.esc-net.de
>>>>>>>> http://thegordian.blogspot.com
>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>
>>>>>>>>> Thanks Christophe
>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687274 is a reply to message #687065] Thu, 26 May 2011 16:11 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 26.05.2011 18:07, schrieb Martin Taal:
> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
Can I see your process() method?

> For what event should the listener be configured?
IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.

> Something like the repository-up-and-running event, is there something like that?
Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a LifecycleEventAdapter.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
>>> ping when a repository is up and running?
>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>
>> <extension point="org.eclipse.net4j.util.elementProcessors">
>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>> </extension>
>>
>>
>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the time you
>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the container a
>>>> factory to create one. Can you post an executable example?
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>> Yeah the commit info handler :-)
>>>>>
>>>>> I have this in my activator:
>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>> REPO_NAME);
>>>>> final OutputStream os = new FileOutputStream(
>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>
>>>>> but then I get this:
>>>>>
>>>>>
>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>> !STACK 0
>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>> com.netxforge.netxstudio.server was unable to load class com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>> at
>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>> at
>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>
>>>>>
>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>> ... 15 more
>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>> at
>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>> ... 19 more
>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>> bundle com.netxforge.netxstudio.server.
>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>> ... 31 more
>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>> ... 37 more
>>>>>
>>>>>
>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>> Hi Eike,
>>>>>>> The commit info
>>>>>> commit info handler ;-)
>>>>>>
>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>>>>>> already be running
>>>>>> No, these handlers can be added/removed at any time.
>>>>>>
>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>> Hi Eike,
>>>>>>>>
>>>>>>>> That's just great, thanks!
>>>>>>>> Christophe
>>>>>>>>
>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>> Hi Christophe,
>>>>>>>>>
>>>>>>>>> Please have a look at
>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>> handlers:
>>>>>>>>>
>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>
>>>>>>>>> They've been added with:
>>>>>>>>>
>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike
>>>>>>>>>
>>>>>>>>> ----
>>>>>>>>> http://www.esc-net.de
>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>
>>>>>>>>>> Thanks Christophe
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687275 is a reply to message #687066] Thu, 26 May 2011 16:50 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
For the element processor, I should wait for a specific element type?

I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there. So
I should probably wait for a specific container event, which one?

IPluginContainer.INSTANCE.addListener(new IListener() {

@Override
public void notifyEvent(IEvent event) {
if (event instanceof IContainerEvent) {
final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
REPO_NAME);
final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
asyncCommitInfoHandler.activate();
repo.addCommitInfoHandler(asyncCommitInfoHandler);
}
}

});



On 05/26/2011 06:11 PM, Eike Stepper wrote:
> Am 26.05.2011 18:07, schrieb Martin Taal:
>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
> Can I see your process() method?
>
>> For what event should the listener be configured?
> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>
>> Something like the repository-up-and-running event, is there something like that?
> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
> LifecycleEventAdapter.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
>>>> ping when a repository is up and running?
>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>
>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>> </extension>
>>>
>>>
>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>>>
>>>> gr. Martin
>>>>
>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>> time you
>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>> container a
>>>>> factory to create one. Can you post an executable example?
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>
>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>> Yeah the commit info handler :-)
>>>>>>
>>>>>> I have this in my activator:
>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>> REPO_NAME);
>>>>>> final OutputStream os = new FileOutputStream(
>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>
>>>>>> but then I get this:
>>>>>>
>>>>>>
>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>> !STACK 0
>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>> at
>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>> at
>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>> ... 15 more
>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>> at
>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>> ... 19 more
>>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>> ... 31 more
>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>> ... 37 more
>>>>>>
>>>>>>
>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>> Hi Eike,
>>>>>>>> The commit info
>>>>>>> commit info handler ;-)
>>>>>>>
>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository should
>>>>>>>> already be running
>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>
>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> gr. Martin
>>>>>>>>
>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>> Hi Eike,
>>>>>>>>>
>>>>>>>>> That's just great, thanks!
>>>>>>>>> Christophe
>>>>>>>>>
>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>> Hi Christophe,
>>>>>>>>>>
>>>>>>>>>> Please have a look at
>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>> handlers:
>>>>>>>>>>
>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>
>>>>>>>>>> They've been added with:
>>>>>>>>>>
>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>
>>>>>>>>>> Cheers
>>>>>>>>>> /Eike
>>>>>>>>>>
>>>>>>>>>> ----
>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>
>>>>>>>>>>> Thanks Christophe
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687278 is a reply to message #687067] Thu, 26 May 2011 17:20 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Am 26.05.2011 18:50, schrieb Martin Taal:
<blockquote cite="mid:irlvsc$2h2$1@news.eclipse.org" type="cite">For
the element processor, I should wait for a specific element type?
<br>
</blockquote>
IRepository? :P<br>
<br>
I've tried to create an example for you:<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = -->
<!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3"
cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td nowrap="nowrap" align="left"
valign="top"> <code>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>class&nbsp;</b></font><font
color="#000000">RepositoryCommitLogConfigurer&nbsp;</font><font
color="#7f0055"><b>implements&nbsp;</b></font><font
color="#000000">IElementProcessor</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#000000">Object&nbsp;process</font><font
color="#000000">(</font><font color="#000000">IManagedContainer&nbsp;container,&nbsp;String&nbsp;productGroup,&nbsp;String&nbsp;factoryType,&nbsp;String&nbsp;description,</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Object&nbsp;element</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>if&nbsp;</b></font><font color="#000000">(</font><font
color="#000000">element&nbsp;</font><font color="#7f0055"><b>instanceof&nbsp;</b></font><font
color="#000000">IRepository</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>try</b></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">processRepository</font><font
color="#000000">((</font><font color="#000000">IRepository</font><font
color="#000000">)</font><font color="#000000">element</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>catch&nbsp;</b></font><font
color="#000000">(</font><font color="#000000">Exception&nbsp;ex</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">OM.LOG.warn</font><font
color="#000000">(</font><font color="#2a00ff">"Problem&nbsp;with&nbsp;commit&nbsp;log&nbsp;setup"</font><font
color="#000000">,&nbsp;ex</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>return&nbsp;</b></font><font
color="#000000">element;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>private&nbsp;</b></font><font
color="#7f0055"><b>void&nbsp;</b></font><font
color="#000000">processRepository</font><font
color="#000000">(</font><font color="#000000">IRepository&nbsp;repository</font><font
color="#000000">)&nbsp;</font><font color="#7f0055"><b>throws&nbsp;</b></font><font
color="#000000">FileNotFoundException</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>final&nbsp;</b></font><font
color="#000000">OutputStream&nbsp;os&nbsp;=&nbsp;</font><font
color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">FileOutputStream</font><font
color="#000000">(</font><font color="#2a00ff">"/home/mtaal/mytmp/test.commitinfo"</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">repository.addCommitInfoHandler</font><font
color="#000000">(</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">TextCommitInfoLog</font><font
color="#000000">(</font><font color="#000000">os</font><font
color="#000000">))</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">repository.addListener</font><font
color="#000000">(</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">LifecycleEventAdapter</font><font
color="#000000">()</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#646464">@Override</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>protected&nbsp;</b></font><font
color="#7f0055"><b>void&nbsp;</b></font><font
color="#000000">onDeactivated</font><font
color="#000000">(</font><font color="#000000">ILifecycle&nbsp;lifecycle</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">IOUtil.close</font><font
color="#000000">(</font><font color="#000000">os</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">})</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">IPluginContainer.INSTANCE.addPostProcessor</font><font
color="#000000">(</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">RepositoryCommitLogConfigurer</font><font
color="#000000">())</font><font color="#000000">;</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== -->
<br>
The last line can also be replaced with some markup in the
plugin.xml (see previous post).<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a><br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
<blockquote cite="mid:irlvsc$2h2$1@news.eclipse.org" type="cite">
<br>
I tried the listener, it fails the first time it gets called but
after a few calls the repository seems to be there. So I should
probably wait for a specific container event, which one?
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IPluginContainer.INSTANCE.addListener(new IListener() {
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @Override
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void notifyEvent(IEvent event) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (event instanceof IContainerEvent) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; final IContainer&lt;?&gt; container =
((IContainerEvent&lt;?&gt;)event).getSource();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; final IRepository repo =
CDOServerUtil.getRepository((IManagedContainer)container,
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REPO_NAME);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; final AsyncCommitInfoHandler
asyncCommitInfoHandler = new AsyncCommitInfoHandler(new
NetxForgeCommitInfoHandler());
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; asyncCommitInfoHandler.activate();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
repo.addCommitInfoHandler(asyncCommitInfoHandler);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });
<br>
<br>
<br>
<br>
On 05/26/2011 06:11 PM, Eike Stepper wrote:
<br>
<blockquote type="cite">Am 26.05.2011 18:07, schrieb Martin Taal:
<br>
<blockquote type="cite">If I use the element processor I get the
same error, there is no repository when the elements gets
parsed.
<br>
</blockquote>
Can I see your process() method?
<br>
<br>
<blockquote type="cite">For what event should the listener be
configured?
<br>
</blockquote>
IContainerEvent. You can also extend
org.eclipse.net4j.util.container.ContainerEventAdapter&lt;E&gt;.
<br>
<br>
<blockquote type="cite">Something like the
repository-up-and-running event, is there something like that?
<br>
</blockquote>
Yes, the repo fires ILifecycleEvents but you'd need to hold on
the repo before you can even register a
<br>
LifecycleEventAdapter.
<br>
<br>
Cheers
<br>
/Eike
<br>
<br>
----
<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a>
<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a>
<br>
<br>
<br>
<blockquote type="cite">
<br>
gr. Martin
<br>
<br>
On 05/26/2011 05:52 PM, Eike Stepper wrote:
<br>
<blockquote type="cite">Am 26.05.2011 12:15, schrieb Martin
Taal:
<br>
<blockquote type="cite">It is kind of difficult to create an
executable example, I put this code in the Activator of a
plugin. I can imagine
<br>
that this activator is called before the cdo repository is
up and running. Can I add a listener somehow which gets a
<br>
ping when a repository is up and running?
<br>
</blockquote>
What about
IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)?
You can also do it declaratively like:
<br>
<br>
&lt;extension
point="org.eclipse.net4j.util.elementProcessors"&gt;
<br>
&lt;elementProcessor
class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/&gt;<br>
&lt;elementProcessor
class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/&gt;<br>
&lt;/extension&gt;
<br>
<br>
<br>
IPluginContainer.INSTANCE.addListener(logConfigurer) should
also work because you don't need an early lifecycle phase.
<br>
<br>
Cheers
<br>
/Eike
<br>
<br>
----
<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a>
<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a>
<br>
<br>
<br>
<br>
<blockquote type="cite">
<br>
gr. Martin
<br>
<br>
On 05/26/2011 11:22 AM, Eike Stepper wrote:
<br>
<blockquote type="cite">I can't see how the exception is
related to the addition of the TextCommitInfoLog. To me
it seems as if, at the
<br>
time you
<br>
call CDOServerUtil.getRepository() there is neither a
repository with that name in the container nor has the
<br>
container a
<br>
factory to create one. Can you post an executable
example?
<br>
<br>
Cheers
<br>
/Eike
<br>
<br>
----
<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a>
<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a>
<br>
<br>
<br>
<br>
Am 26.05.2011 10:57, schrieb Martin Taal:
<br>
<blockquote type="cite">Yeah the commit info handler :-)
<br>
<br>
I have this in my activator:
<br>
final IManagedContainer container =
IPluginContainer.INSTANCE;
<br>
final IRepository repo =
CDOServerUtil.getRepository(container,
<br>
REPO_NAME);
<br>
final OutputStream os = new FileOutputStream(
<br>
"/home/mtaal/mytmp/test.commitinfo");
<br>
repo.addCommitInfoHandler(new TextCommitInfoLog(os));
<br>
<br>
but then I get this:
<br>
<br>
<br>
!ENTRY org.eclipse.equinox.app 4 0 2011-05-26
09:50:34.903
<br>
!MESSAGE org.eclipse.core.runtime.CoreException:
Plug-in com.netxforge.netxstudio.server was unable to
load class
<br>
com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
<br>
!STACK 0
<br>
org.eclipse.net4j.util.factory.FactoryCreationException:
org.eclipse.core.runtime.CoreException: Plug-in
<br>
com.netxforge.netxstudio.server was unable to load
class
<br>
com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
<br>
at
org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)<br>
at
org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)<br>
at
org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)<br>
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)<br>
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)<br>
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)<br>
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)<br>
at
org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)<br>
at
org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
<br>
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)<br>
at
org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)<br>
at java.lang.Thread.run(Thread.java:679)
<br>
Caused by: org.eclipse.core.runtime.CoreException:
Plug-in com.netxforge.netxstudio.server was unable to
load class
<br>
com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
<br>
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)<br>
at
<br>
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
<br>
at
org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)<br>
at
org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)<br>
at
<br>
org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
<br>
<br>
<br>
<br>
at
org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)<br>
... 15 more
<br>
Caused by:
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException:
An error
<br>
occurred while automatically activating bundle
com.netxforge.netxstudio.server (27).
<br>
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)<br>
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)<br>
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)<br>
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)<br>
at
java.lang.ClassLoader.loadClass(ClassLoader.java:266)
<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)<br>
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)<br>
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)<br>
at
<br>
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
<br>
... 19 more
<br>
Caused by: org.osgi.framework.BundleException:
Exception in
com.netxforge.netxstudio.server.Activator.start() of
<br>
bundle com.netxforge.netxstudio.server.
<br>
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)<br>
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)<br>
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)<br>
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)<br>
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)<br>
at
org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)<br>
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)<br>
... 31 more
<br>
Caused by:
org.eclipse.net4j.util.container.FactoryNotFoundException:
Factory not found:
<br>
org.eclipse.emf.cdo.server.repositories[default]
<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)<br>
at
org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)<br>
at
org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)<br>
at
org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)<br>
at
com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)<br>
at
com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
<br>
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)<br>
at java.security.AccessController.doPrivileged(Native
Method)
<br>
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)<br>
... 37 more
<br>
<br>
<br>
On 05/26/2011 10:18 AM, Eike Stepper wrote:
<br>
<blockquote type="cite">Am 26.05.2011 09:53, schrieb
Martin Taal:
<br>
<blockquote type="cite">Hi Eike,
<br>
The commit info
<br>
</blockquote>
commit info handler ;-)
<br>
<br>
<blockquote type="cite">needs to be added to the
repository programmatically. What is a good place
to do this? I mean the repository should
<br>
already be running
<br>
</blockquote>
No, these handlers can be added/removed at any time.
<br>
<br>
<blockquote type="cite">so it can't be done in some
Activator. Is there a logical place for these
repository configuration code?
<br>
</blockquote>
If you submit a bugzilla we could try to enhance the
RepositoryConfigurator that interprets the
cdo-server.xml
<br>
<br>
Cheers
<br>
/Eike
<br>
<br>
----
<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a>
<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a>
<br>
<br>
<br>
<blockquote type="cite">
<br>
gr. Martin
<br>
<br>
On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
<br>
<blockquote type="cite">Hi Eike,
<br>
<br>
That's just great, thanks!
<br>
Christophe
<br>
<br>
On 24-05-11 09:39, Eike Stepper wrote:
<br>
<blockquote type="cite">Hi Christophe,
<br>
<br>
Please have a look at
<br>
IRepository.addCommitInfoHandler(CDOCommitInfoHandler)
and these default
<br>
handlers:
<br>
<br>
org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
<br>
org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
<br>
org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
<br>
<br>
They've been added with:
<br>
<br>
333460: Would like to have all commit sets in
a log file
<br>
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460">https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460</a>
<br>
<br>
Cheers
<br>
/Eike
<br>
<br>
----
<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a>
<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a>
<br>
<br>
<br>
<br>
Am 24.05.2011 09:25, schrieb Christophe
Bouhier:
<br>
<blockquote type="cite">Hi, We have a
requirement to log activity per user. So
this could be
<br>
an object being created, modified or
deleted. It could also be a
<br>
reference being created, modified or
deleted. Is there a capability in
<br>
CDO to do this (Server side), perhaps
linking a CDOSession and CDOView ?
<br>
<br>
Thanks Christophe
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
<br>
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
</body>
</html>


Re: [CDO] logging of session/user activity. [message #687280 is a reply to message #687069] Thu, 26 May 2011 19:57 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.

gr. Martin

On 05/26/2011 07:20 PM, Eike Stepper wrote:
> Am 26.05.2011 18:50, schrieb Martin Taal:
>> For the element processor, I should wait for a specific element type?
> IRepository? :P
>
> I've tried to create an example for you:
>
> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
> {
> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
> Object element)
> {
> *if *(element *instanceof *IRepository)
> {
> *try*
> {
> processRepository((IRepository)element);
> }
> *catch *(Exception ex)
> {
> OM.LOG.warn("Problem with commit log setup", ex);
> }
> }
>
> *return *element;
> }
>
> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
> {
> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>
> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
> repository.addListener(*new *LifecycleEventAdapter()
> {
> @Override
> *protected **void *onDeactivated(ILifecycle lifecycle)
> {
> IOUtil.close(os);
> }
> });
> }
> }
>
> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>
>
> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>> So I should probably wait for a specific container event, which one?
>>
>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>
>> @Override
>> public void notifyEvent(IEvent event) {
>> if (event instanceof IContainerEvent) {
>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>> REPO_NAME);
>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>> asyncCommitInfoHandler.activate();
>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>> }
>> }
>>
>> });
>>
>>
>>
>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>> Can I see your process() method?
>>>
>>>> For what event should the listener be configured?
>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>
>>>> Something like the repository-up-and-running event, is there something like that?
>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>> LifecycleEventAdapter.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> gr. Martin
>>>>
>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
>>>>>> ping when a repository is up and running?
>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>
>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>> </extension>
>>>>>
>>>>>
>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>> time you
>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>> container a
>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>
>>>>>>>> I have this in my activator:
>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>> REPO_NAME);
>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>
>>>>>>>> but then I get this:
>>>>>>>>
>>>>>>>>
>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>> !STACK 0
>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>> at
>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>
>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>> at
>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>> ... 15 more
>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>> at
>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>
>>>>>>>> ... 19 more
>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>> ... 31 more
>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>> ... 37 more
>>>>>>>>
>>>>>>>>
>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>> Hi Eike,
>>>>>>>>>> The commit info
>>>>>>>>> commit info handler ;-)
>>>>>>>>>
>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>> should
>>>>>>>>>> already be running
>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>
>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike
>>>>>>>>>
>>>>>>>>> ----
>>>>>>>>> http://www.esc-net.de
>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> gr. Martin
>>>>>>>>>>
>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>
>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>> Christophe
>>>>>>>>>>>
>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>
>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>> handlers:
>>>>>>>>>>>>
>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>
>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>
>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>
>>>>>>>>>>>> Cheers
>>>>>>>>>>>> /Eike
>>>>>>>>>>>>
>>>>>>>>>>>> ----
>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687281 is a reply to message #687071] Thu, 26 May 2011 20:50 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 26.05.2011 21:57, schrieb Martin Taal:
> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
If I can't try it I run out of ideas ;-(

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>> For the element processor, I should wait for a specific element type?
>> IRepository? :P
>>
>> I've tried to create an example for you:
>>
>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>> {
>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>> Object element)
>> {
>> *if *(element *instanceof *IRepository)
>> {
>> *try*
>> {
>> processRepository((IRepository)element);
>> }
>> *catch *(Exception ex)
>> {
>> OM.LOG.warn("Problem with commit log setup", ex);
>> }
>> }
>>
>> *return *element;
>> }
>>
>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>> {
>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>
>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>> repository.addListener(*new *LifecycleEventAdapter()
>> {
>> @Override
>> *protected **void *onDeactivated(ILifecycle lifecycle)
>> {
>> IOUtil.close(os);
>> }
>> });
>> }
>> }
>>
>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>
>>
>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>>> So I should probably wait for a specific container event, which one?
>>>
>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>
>>> @Override
>>> public void notifyEvent(IEvent event) {
>>> if (event instanceof IContainerEvent) {
>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>> REPO_NAME);
>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>> asyncCommitInfoHandler.activate();
>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>> }
>>> }
>>>
>>> });
>>>
>>>
>>>
>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>> Can I see your process() method?
>>>>
>>>>> For what event should the listener be configured?
>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>
>>>>> Something like the repository-up-and-running event, is there something like that?
>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>> LifecycleEventAdapter.
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can imagine
>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which gets a
>>>>>>> ping when a repository is up and running?
>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>
>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>> </extension>
>>>>>>
>>>>>>
>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle phase.
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>>> time you
>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>> container a
>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> /Eike
>>>>>>>>
>>>>>>>> ----
>>>>>>>> http://www.esc-net.de
>>>>>>>> http://thegordian.blogspot.com
>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>
>>>>>>>>> I have this in my activator:
>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>> REPO_NAME);
>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>
>>>>>>>>> but then I get this:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>> !STACK 0
>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>> at
>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>
>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>> at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>> at
>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>> ... 15 more
>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error
>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>> at
>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>
>>>>>>>>> ... 19 more
>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>> ... 31 more
>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>> ... 37 more
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>> Hi Eike,
>>>>>>>>>>> The commit info
>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>
>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>>> should
>>>>>>>>>>> already be running
>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>
>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>>
>>>>>>>>>> Cheers
>>>>>>>>>> /Eike
>>>>>>>>>>
>>>>>>>>>> ----
>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> gr. Martin
>>>>>>>>>>>
>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>
>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>> Christophe
>>>>>>>>>>>>
>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>
>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>
>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>
>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>
>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>
>>>>>>>>>>>>> ----
>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687282 is a reply to message #687072] Thu, 26 May 2011 20:55 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Eike,
You mean that in your case this element processor gets a Repository instance?

gr. Martin

On 05/26/2011 10:50 PM, Eike Stepper wrote:
> Am 26.05.2011 21:57, schrieb Martin Taal:
>> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
> If I can't try it I run out of ideas ;-(
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>>> For the element processor, I should wait for a specific element type?
>>> IRepository? :P
>>>
>>> I've tried to create an example for you:
>>>
>>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>>> {
>>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>>> Object element)
>>> {
>>> *if *(element *instanceof *IRepository)
>>> {
>>> *try*
>>> {
>>> processRepository((IRepository)element);
>>> }
>>> *catch *(Exception ex)
>>> {
>>> OM.LOG.warn("Problem with commit log setup", ex);
>>> }
>>> }
>>>
>>> *return *element;
>>> }
>>>
>>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>>> {
>>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>>
>>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>>> repository.addListener(*new *LifecycleEventAdapter()
>>> {
>>> @Override
>>> *protected **void *onDeactivated(ILifecycle lifecycle)
>>> {
>>> IOUtil.close(os);
>>> }
>>> });
>>> }
>>> }
>>>
>>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>>
>>>
>>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>>>> So I should probably wait for a specific container event, which one?
>>>>
>>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>>
>>>> @Override
>>>> public void notifyEvent(IEvent event) {
>>>> if (event instanceof IContainerEvent) {
>>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>>> REPO_NAME);
>>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>>> asyncCommitInfoHandler.activate();
>>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>>> }
>>>> }
>>>>
>>>> });
>>>>
>>>>
>>>>
>>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>>> Can I see your process() method?
>>>>>
>>>>>> For what event should the listener be configured?
>>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>>
>>>>>> Something like the repository-up-and-running event, is there something like that?
>>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>>> LifecycleEventAdapter.
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can
>>>>>>>> imagine
>>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which
>>>>>>>> gets a
>>>>>>>> ping when a repository is up and running?
>>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>>
>>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>>> </extension>
>>>>>>>
>>>>>>>
>>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle
>>>>>>> phase.
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> gr. Martin
>>>>>>>>
>>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>>>> time you
>>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>>> container a
>>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike
>>>>>>>>>
>>>>>>>>> ----
>>>>>>>>> http://www.esc-net.de
>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>>
>>>>>>>>>> I have this in my activator:
>>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>>> REPO_NAME);
>>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>>
>>>>>>>>>> but then I get this:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>> !STACK 0
>>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>> class
>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>>> ... 15 more
>>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An
>>>>>>>>>> error
>>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ... 19 more
>>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>>> ... 31 more
>>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>>> ... 37 more
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>> The commit info
>>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>>
>>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>>>> should
>>>>>>>>>>>> already be running
>>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>>
>>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>>>
>>>>>>>>>>> Cheers
>>>>>>>>>>> /Eike
>>>>>>>>>>>
>>>>>>>>>>> ----
>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>
>>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>
>>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>>> Christophe
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687285 is a reply to message #687073] Fri, 27 May 2011 06:13 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 26.05.2011 22:55, schrieb Martin Taal:
> Hi Eike,
> You mean that in your case this element processor gets a Repository instance?
No, that means that I did not run my code. It all depends on if/how/when the repository is created and if/how/when it is made available in the container. There are thousand ways possible.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 05/26/2011 10:50 PM, Eike Stepper wrote:
>> Am 26.05.2011 21:57, schrieb Martin Taal:
>>> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
>> If I can't try it I run out of ideas ;-(
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>>>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>>>> For the element processor, I should wait for a specific element type?
>>>> IRepository? :P
>>>>
>>>> I've tried to create an example for you:
>>>>
>>>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>>>> {
>>>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>>>> Object element)
>>>> {
>>>> *if *(element *instanceof *IRepository)
>>>> {
>>>> *try*
>>>> {
>>>> processRepository((IRepository)element);
>>>> }
>>>> *catch *(Exception ex)
>>>> {
>>>> OM.LOG.warn("Problem with commit log setup", ex);
>>>> }
>>>> }
>>>>
>>>> *return *element;
>>>> }
>>>>
>>>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>>>> {
>>>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>>>
>>>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>>>> repository.addListener(*new *LifecycleEventAdapter()
>>>> {
>>>> @Override
>>>> *protected **void *onDeactivated(ILifecycle lifecycle)
>>>> {
>>>> IOUtil.close(os);
>>>> }
>>>> });
>>>> }
>>>> }
>>>>
>>>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>>>
>>>>
>>>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>>
>>>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>>>>> So I should probably wait for a specific container event, which one?
>>>>>
>>>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>>>
>>>>> @Override
>>>>> public void notifyEvent(IEvent event) {
>>>>> if (event instanceof IContainerEvent) {
>>>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>>>> REPO_NAME);
>>>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>>>> asyncCommitInfoHandler.activate();
>>>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>>>> }
>>>>> }
>>>>>
>>>>> });
>>>>>
>>>>>
>>>>>
>>>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>>>> Can I see your process() method?
>>>>>>
>>>>>>> For what event should the listener be configured?
>>>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>>>
>>>>>>> Something like the repository-up-and-running event, is there something like that?
>>>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>>>> LifecycleEventAdapter.
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can
>>>>>>>>> imagine
>>>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which
>>>>>>>>> gets a
>>>>>>>>> ping when a repository is up and running?
>>>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>>>
>>>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>>>> </extension>
>>>>>>>>
>>>>>>>>
>>>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle
>>>>>>>> phase.
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> /Eike
>>>>>>>>
>>>>>>>> ----
>>>>>>>> http://www.esc-net.de
>>>>>>>> http://thegordian.blogspot.com
>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> gr. Martin
>>>>>>>>>
>>>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>>>>> time you
>>>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>>>> container a
>>>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>>>
>>>>>>>>>> Cheers
>>>>>>>>>> /Eike
>>>>>>>>>>
>>>>>>>>>> ----
>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>>>
>>>>>>>>>>> I have this in my activator:
>>>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>>>> REPO_NAME);
>>>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>>>
>>>>>>>>>>> but then I get this:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>> !STACK 0
>>>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>> class
>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>>>> at
>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>>>> at
>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>>>> at
>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>>>> ... 15 more
>>>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An
>>>>>>>>>>> error
>>>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>>>> at
>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ... 19 more
>>>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>>>> ... 31 more
>>>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>>>> ... 37 more
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>> The commit info
>>>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>>>
>>>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>>>>> should
>>>>>>>>>>>>> already be running
>>>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>>>
>>>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>>>>
>>>>>>>>>>>> Cheers
>>>>>>>>>>>> /Eike
>>>>>>>>>>>>
>>>>>>>>>>>> ----
>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>>>> Christophe
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687290 is a reply to message #687075] Fri, 27 May 2011 09:16 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Eike,
I use the cdo-server.xml which I attached. Does this help?

gr. Martin

On 05/27/2011 08:13 AM, Eike Stepper wrote:
> Am 26.05.2011 22:55, schrieb Martin Taal:
>> Hi Eike,
>> You mean that in your case this element processor gets a Repository instance?
> No, that means that I did not run my code. It all depends on if/how/when the repository is created and if/how/when it is
> made available in the container. There are thousand ways possible.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 05/26/2011 10:50 PM, Eike Stepper wrote:
>>> Am 26.05.2011 21:57, schrieb Martin Taal:
>>>> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
>>> If I can't try it I run out of ideas ;-(
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> gr. Martin
>>>>
>>>> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>>>>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>>>>> For the element processor, I should wait for a specific element type?
>>>>> IRepository? :P
>>>>>
>>>>> I've tried to create an example for you:
>>>>>
>>>>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>>>>> {
>>>>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>>>>> Object element)
>>>>> {
>>>>> *if *(element *instanceof *IRepository)
>>>>> {
>>>>> *try*
>>>>> {
>>>>> processRepository((IRepository)element);
>>>>> }
>>>>> *catch *(Exception ex)
>>>>> {
>>>>> OM.LOG.warn("Problem with commit log setup", ex);
>>>>> }
>>>>> }
>>>>>
>>>>> *return *element;
>>>>> }
>>>>>
>>>>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>>>>> {
>>>>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>>>>
>>>>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>>>>> repository.addListener(*new *LifecycleEventAdapter()
>>>>> {
>>>>> @Override
>>>>> *protected **void *onDeactivated(ILifecycle lifecycle)
>>>>> {
>>>>> IOUtil.close(os);
>>>>> }
>>>>> });
>>>>> }
>>>>> }
>>>>>
>>>>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>>>>
>>>>>
>>>>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>>
>>>>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>>>>>> So I should probably wait for a specific container event, which one?
>>>>>>
>>>>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>>>>
>>>>>> @Override
>>>>>> public void notifyEvent(IEvent event) {
>>>>>> if (event instanceof IContainerEvent) {
>>>>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>>>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>>>>> REPO_NAME);
>>>>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>>>>> asyncCommitInfoHandler.activate();
>>>>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> });
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>>>>> Can I see your process() method?
>>>>>>>
>>>>>>>> For what event should the listener be configured?
>>>>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>>>>
>>>>>>>> Something like the repository-up-and-running event, is there something like that?
>>>>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>>>>> LifecycleEventAdapter.
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> gr. Martin
>>>>>>>>
>>>>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can
>>>>>>>>>> imagine
>>>>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which
>>>>>>>>>> gets a
>>>>>>>>>> ping when a repository is up and running?
>>>>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>>>>
>>>>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>>>>> </extension>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle
>>>>>>>>> phase.
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike
>>>>>>>>>
>>>>>>>>> ----
>>>>>>>>> http://www.esc-net.de
>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> gr. Martin
>>>>>>>>>>
>>>>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>>>>>> time you
>>>>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>>>>> container a
>>>>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>>>>
>>>>>>>>>>> Cheers
>>>>>>>>>>> /Eike
>>>>>>>>>>>
>>>>>>>>>>> ----
>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>>>>
>>>>>>>>>>>> I have this in my activator:
>>>>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>>>>> REPO_NAME);
>>>>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>>>>
>>>>>>>>>>>> but then I get this:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>> class
>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>> !STACK 0
>>>>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>> class
>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>>>>> at
>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>>>>> at
>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>>>>>
>>>>>>>>>>>> at
>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>>>>> ... 15 more
>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An
>>>>>>>>>>>> error
>>>>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>>>>> at
>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ... 19 more
>>>>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in
>>>>>>>>>>>> com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>>>>> ... 31 more
>>>>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>>>>> ... 37 more
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>> The commit info
>>>>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>>>>
>>>>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>>>>>> should
>>>>>>>>>>>>>> already be running
>>>>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>>>>
>>>>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>>>>>
>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>
>>>>>>>>>>>>> ----
>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>>>>> Christophe
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] logging of session/user activity. [message #687292 is a reply to message #687079] Fri, 27 May 2011 10:02 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Hi Martin,

Sorry, I realized a little late that there's an issue with ManagedContainer.putElement() in that does not call element processors. I've fixed that in bugzilla:

347427: ManagedContainer.putElement() does not call element processors
https://bugs.eclipse.org/bugs/show_bug.cgi?id=347427

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 27.05.2011 11:16, schrieb Martin Taal:
> Hi Eike,
> I use the cdo-server.xml which I attached. Does this help?
>
> gr. Martin
>
> On 05/27/2011 08:13 AM, Eike Stepper wrote:
>> Am 26.05.2011 22:55, schrieb Martin Taal:
>>> Hi Eike,
>>> You mean that in your case this element processor gets a Repository instance?
>> No, that means that I did not run my code. It all depends on if/how/when the repository is created and if/how/when it is
>> made available in the container. There are thousand ways possible.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 05/26/2011 10:50 PM, Eike Stepper wrote:
>>>> Am 26.05.2011 21:57, schrieb Martin Taal:
>>>>> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
>>>> If I can't try it I run out of ideas ;-(
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>>>>>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>>>>>> For the element processor, I should wait for a specific element type?
>>>>>> IRepository? :P
>>>>>>
>>>>>> I've tried to create an example for you:
>>>>>>
>>>>>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>>>>>> {
>>>>>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>>>>>> Object element)
>>>>>> {
>>>>>> *if *(element *instanceof *IRepository)
>>>>>> {
>>>>>> *try*
>>>>>> {
>>>>>> processRepository((IRepository)element);
>>>>>> }
>>>>>> *catch *(Exception ex)
>>>>>> {
>>>>>> OM.LOG.warn("Problem with commit log setup", ex);
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> *return *element;
>>>>>> }
>>>>>>
>>>>>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>>>>>> {
>>>>>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>>>>>
>>>>>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>>>>>> repository.addListener(*new *LifecycleEventAdapter()
>>>>>> {
>>>>>> @Override
>>>>>> *protected **void *onDeactivated(ILifecycle lifecycle)
>>>>>> {
>>>>>> IOUtil.close(os);
>>>>>> }
>>>>>> });
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>>>>>
>>>>>>
>>>>>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be there.
>>>>>>> So I should probably wait for a specific container event, which one?
>>>>>>>
>>>>>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>>>>>
>>>>>>> @Override
>>>>>>> public void notifyEvent(IEvent event) {
>>>>>>> if (event instanceof IContainerEvent) {
>>>>>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>>>>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>>>>>> REPO_NAME);
>>>>>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>>>>>> asyncCommitInfoHandler.activate();
>>>>>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> });
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>>>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>>>>>> Can I see your process() method?
>>>>>>>>
>>>>>>>>> For what event should the listener be configured?
>>>>>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>>>>>
>>>>>>>>> Something like the repository-up-and-running event, is there something like that?
>>>>>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>>>>>> LifecycleEventAdapter.
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> /Eike
>>>>>>>>
>>>>>>>> ----
>>>>>>>> http://www.esc-net.de
>>>>>>>> http://thegordian.blogspot.com
>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> gr. Martin
>>>>>>>>>
>>>>>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can
>>>>>>>>>>> imagine
>>>>>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which
>>>>>>>>>>> gets a
>>>>>>>>>>> ping when a repository is up and running?
>>>>>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>>>>>
>>>>>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>>>>>> </extension>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle
>>>>>>>>>> phase.
>>>>>>>>>>
>>>>>>>>>> Cheers
>>>>>>>>>> /Eike
>>>>>>>>>>
>>>>>>>>>> ----
>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> gr. Martin
>>>>>>>>>>>
>>>>>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at the
>>>>>>>>>>>> time you
>>>>>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>>>>>> container a
>>>>>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>>>>>
>>>>>>>>>>>> Cheers
>>>>>>>>>>>> /Eike
>>>>>>>>>>>>
>>>>>>>>>>>> ----
>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>>>>>
>>>>>>>>>>>>> I have this in my activator:
>>>>>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>>>>>> REPO_NAME);
>>>>>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>>>>>
>>>>>>>>>>>>> but then I get this:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>>> class
>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>> !STACK 0
>>>>>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>>> class
>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>>>>>> ... 15 more
>>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An
>>>>>>>>>>>>> error
>>>>>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ... 19 more
>>>>>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in
>>>>>>>>>>>>> com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>>>>>> at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>>>>>> ... 31 more
>>>>>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>>>>>> ... 37 more
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>> The commit info
>>>>>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the repository
>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>> already be running
>>>>>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the cdo-server.xml
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>>>>>> Christophe
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: [CDO] logging of session/user activity. [message #687294 is a reply to message #687080] Fri, 27 May 2011 10:41 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Thanks Eike, I will pick up the build which contains this and try it out.

gr. Martin

On 05/27/2011 12:02 PM, Eike Stepper wrote:
> Hi Martin,
>
> Sorry, I realized a little late that there's an issue with ManagedContainer.putElement() in that does not call element
> processors. I've fixed that in bugzilla:
>
> 347427: ManagedContainer.putElement() does not call element processors
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=347427
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 27.05.2011 11:16, schrieb Martin Taal:
>> Hi Eike,
>> I use the cdo-server.xml which I attached. Does this help?
>>
>> gr. Martin
>>
>> On 05/27/2011 08:13 AM, Eike Stepper wrote:
>>> Am 26.05.2011 22:55, schrieb Martin Taal:
>>>> Hi Eike,
>>>> You mean that in your case this element processor gets a Repository instance?
>>> No, that means that I did not run my code. It all depends on if/how/when the repository is created and if/how/when it is
>>> made available in the container. There are thousand ways possible.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>> gr. Martin
>>>>
>>>> On 05/26/2011 10:50 PM, Eike Stepper wrote:
>>>>> Am 26.05.2011 21:57, schrieb Martin Taal:
>>>>>> Thanks Eike, I tried it but afaics the element is never a IRepository. I defined this through an extension.
>>>>> If I can't try it I run out of ideas ;-(
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 05/26/2011 07:20 PM, Eike Stepper wrote:
>>>>>>> Am 26.05.2011 18:50, schrieb Martin Taal:
>>>>>>>> For the element processor, I should wait for a specific element type?
>>>>>>> IRepository? :P
>>>>>>>
>>>>>>> I've tried to create an example for you:
>>>>>>>
>>>>>>> |*class *RepositoryCommitLogConfigurer *implements *IElementProcessor
>>>>>>> {
>>>>>>> *public *Object process(IManagedContainer container, String productGroup, String factoryType, String description,
>>>>>>> Object element)
>>>>>>> {
>>>>>>> *if *(element *instanceof *IRepository)
>>>>>>> {
>>>>>>> *try*
>>>>>>> {
>>>>>>> processRepository((IRepository)element);
>>>>>>> }
>>>>>>> *catch *(Exception ex)
>>>>>>> {
>>>>>>> OM.LOG.warn("Problem with commit log setup", ex);
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> *return *element;
>>>>>>> }
>>>>>>>
>>>>>>> *private **void *processRepository(IRepository repository) *throws *FileNotFoundException
>>>>>>> {
>>>>>>> *final *OutputStream os = *new *FileOutputStream("/home/mtaal/mytmp/test.commitinfo");
>>>>>>>
>>>>>>> repository.addCommitInfoHandler(*new *TextCommitInfoLog(os));
>>>>>>> repository.addListener(*new *LifecycleEventAdapter()
>>>>>>> {
>>>>>>> @Override
>>>>>>> *protected **void *onDeactivated(ILifecycle lifecycle)
>>>>>>> {
>>>>>>> IOUtil.close(os);
>>>>>>> }
>>>>>>> });
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> IPluginContainer.INSTANCE.addPostProcessor(*new *RepositoryCommitLogConfigurer());|
>>>>>>>
>>>>>>>
>>>>>>> The last line can also be replaced with some markup in the plugin.xml (see previous post).
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> I tried the listener, it fails the first time it gets called but after a few calls the repository seems to be
>>>>>>>> there.
>>>>>>>> So I should probably wait for a specific container event, which one?
>>>>>>>>
>>>>>>>> IPluginContainer.INSTANCE.addListener(new IListener() {
>>>>>>>>
>>>>>>>> @Override
>>>>>>>> public void notifyEvent(IEvent event) {
>>>>>>>> if (event instanceof IContainerEvent) {
>>>>>>>> final IContainer<?> container = ((IContainerEvent<?>)event).getSource();
>>>>>>>> final IRepository repo = CDOServerUtil.getRepository((IManagedContainer)container,
>>>>>>>> REPO_NAME);
>>>>>>>> final AsyncCommitInfoHandler asyncCommitInfoHandler = new AsyncCommitInfoHandler(new NetxForgeCommitInfoHandler());
>>>>>>>> asyncCommitInfoHandler.activate();
>>>>>>>> repo.addCommitInfoHandler(asyncCommitInfoHandler);
>>>>>>>> }
>>>>>>>> }
>>>>>>>>
>>>>>>>> });
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 05/26/2011 06:11 PM, Eike Stepper wrote:
>>>>>>>>> Am 26.05.2011 18:07, schrieb Martin Taal:
>>>>>>>>>> If I use the element processor I get the same error, there is no repository when the elements gets parsed.
>>>>>>>>> Can I see your process() method?
>>>>>>>>>
>>>>>>>>>> For what event should the listener be configured?
>>>>>>>>> IContainerEvent. You can also extend org.eclipse.net4j.util.container.ContainerEventAdapter<E>.
>>>>>>>>>
>>>>>>>>>> Something like the repository-up-and-running event, is there something like that?
>>>>>>>>> Yes, the repo fires ILifecycleEvents but you'd need to hold on the repo before you can even register a
>>>>>>>>> LifecycleEventAdapter.
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike
>>>>>>>>>
>>>>>>>>> ----
>>>>>>>>> http://www.esc-net.de
>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> gr. Martin
>>>>>>>>>>
>>>>>>>>>> On 05/26/2011 05:52 PM, Eike Stepper wrote:
>>>>>>>>>>> Am 26.05.2011 12:15, schrieb Martin Taal:
>>>>>>>>>>>> It is kind of difficult to create an executable example, I put this code in the Activator of a plugin. I can
>>>>>>>>>>>> imagine
>>>>>>>>>>>> that this activator is called before the cdo repository is up and running. Can I add a listener somehow which
>>>>>>>>>>>> gets a
>>>>>>>>>>>> ping when a repository is up and running?
>>>>>>>>>>> What about IPluginContainer.INSTANCE.addPostProcessor(logConfigurer)? You can also do it declaratively like:
>>>>>>>>>>>
>>>>>>>>>>> <extension point="org.eclipse.net4j.util.elementProcessors">
>>>>>>>>>>> <elementProcessor class="org.eclipse.net4j.util.security.ChallengeNegotiatorConfigurer"/>
>>>>>>>>>>> <elementProcessor class="org.eclipse.emf.cdo.spi.server.RepositoryUserManager$RepositoryInjector"/>
>>>>>>>>>>> </extension>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> IPluginContainer.INSTANCE.addListener(logConfigurer) should also work because you don't need an early lifecycle
>>>>>>>>>>> phase.
>>>>>>>>>>>
>>>>>>>>>>> Cheers
>>>>>>>>>>> /Eike
>>>>>>>>>>>
>>>>>>>>>>> ----
>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>
>>>>>>>>>>>> On 05/26/2011 11:22 AM, Eike Stepper wrote:
>>>>>>>>>>>>> I can't see how the exception is related to the addition of the TextCommitInfoLog. To me it seems as if, at
>>>>>>>>>>>>> the
>>>>>>>>>>>>> time you
>>>>>>>>>>>>> call CDOServerUtil.getRepository() there is neither a repository with that name in the container nor has the
>>>>>>>>>>>>> container a
>>>>>>>>>>>>> factory to create one. Can you post an executable example?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>
>>>>>>>>>>>>> ----
>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Am 26.05.2011 10:57, schrieb Martin Taal:
>>>>>>>>>>>>>> Yeah the commit info handler :-)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I have this in my activator:
>>>>>>>>>>>>>> final IManagedContainer container = IPluginContainer.INSTANCE;
>>>>>>>>>>>>>> final IRepository repo = CDOServerUtil.getRepository(container,
>>>>>>>>>>>>>> REPO_NAME);
>>>>>>>>>>>>>> final OutputStream os = new FileOutputStream(
>>>>>>>>>>>>>> "/home/mtaal/mytmp/test.commitinfo");
>>>>>>>>>>>>>> repo.addCommitInfoHandler(new TextCommitInfoLog(os));
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> but then I get this:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> !ENTRY org.eclipse.equinox.app 4 0 2011-05-26 09:50:34.903
>>>>>>>>>>>>>> !MESSAGE org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>>>> class
>>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>>> !STACK 0
>>>>>>>>>>>>>> org.eclipse.net4j.util.factory.FactoryCreationException: org.eclipse.core.runtime.CoreException: Plug-in
>>>>>>>>>>>>>> com.netxforge.netxstudio.server was unable to load class
>>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:49)
>>>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:41)
>>>>>>>>>>>>>> at org.eclipse.net4j.internal.util.factory.PluginFactoryRegistry.get(PluginFactoryRegistry.java:1)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:190)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:223)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getUserManager(RepositoryConfigurator.java:218)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:173)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:105)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>>>>>>>>>>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>>>>>>>>>>>>> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
>>>>>>>>>>>>>> at java.lang.Thread.run(Thread.java:679)
>>>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.netxforge.netxstudio.server was unable to load
>>>>>>>>>>>>>> class
>>>>>>>>>>>>>> com.netxforge.netxstudio.server.NetxForgeUserManager$Factory.
>>>>>>>>>>>>>> at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at org.eclipse.net4j.util.factory.FactoryDescriptor.createFactory(FactoryDescriptor.java:45)
>>>>>>>>>>>>>> ... 15 more
>>>>>>>>>>>>>> Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An
>>>>>>>>>>>>>> error
>>>>>>>>>>>>>> occurred while automatically activating bundle com.netxforge.netxstudio.server (27).
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
>>>>>>>>>>>>>> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:460)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ... 19 more
>>>>>>>>>>>>>> Caused by: org.osgi.framework.BundleException: Exception in
>>>>>>>>>>>>>> com.netxforge.netxstudio.server.Activator.start() of
>>>>>>>>>>>>>> bundle com.netxforge.netxstudio.server.
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
>>>>>>>>>>>>>> at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
>>>>>>>>>>>>>> ... 31 more
>>>>>>>>>>>>>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
>>>>>>>>>>>>>> org.eclipse.emf.cdo.server.repositories[default]
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:193)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:490)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:281)
>>>>>>>>>>>>>> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:265)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:43)
>>>>>>>>>>>>>> at org.eclipse.emf.cdo.server.CDOServerUtil.getRepository(CDOServerUtil.java:206)
>>>>>>>>>>>>>> at com.netxforge.netxstudio.server.ServerUtils.addCommitInfoHandler(ServerUtils.java:86)
>>>>>>>>>>>>>> at com.netxforge.netxstudio.server.Activator.start(Activator.java:39)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>>>>>>>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>>>>>>> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>>>>>>>>>>>>> ... 37 more
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 05/26/2011 10:18 AM, Eike Stepper wrote:
>>>>>>>>>>>>>>> Am 26.05.2011 09:53, schrieb Martin Taal:
>>>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>>> The commit info
>>>>>>>>>>>>>>> commit info handler ;-)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> needs to be added to the repository programmatically. What is a good place to do this? I mean the
>>>>>>>>>>>>>>>> repository
>>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>>> already be running
>>>>>>>>>>>>>>> No, these handlers can be added/removed at any time.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> so it can't be done in some Activator. Is there a logical place for these repository configuration code?
>>>>>>>>>>>>>>> If you submit a bugzilla we could try to enhance the RepositoryConfigurator that interprets the
>>>>>>>>>>>>>>> cdo-server.xml
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On 05/24/2011 09:49 AM, Christophe Bouhier wrote:
>>>>>>>>>>>>>>>>> Hi Eike,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> That's just great, thanks!
>>>>>>>>>>>>>>>>> Christophe
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On 24-05-11 09:39, Eike Stepper wrote:
>>>>>>>>>>>>>>>>>> Hi Christophe,
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Please have a look at
>>>>>>>>>>>>>>>>>> IRepository.addCommitInfoHandler(CDOCommitInfoHandler) and these default
>>>>>>>>>>>>>>>>>> handlers:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.AsyncCommitInfoHandler
>>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.BinaryCommitInfoLog
>>>>>>>>>>>>>>>>>> org.eclipse.emf.cdo.common.commit.handler.TextCommitInfoLog
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> They've been added with:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> 333460: Would like to have all commit sets in a log file
>>>>>>>>>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=333460
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Cheers
>>>>>>>>>>>>>>>>>> /Eike
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> ----
>>>>>>>>>>>>>>>>>> http://www.esc-net.de
>>>>>>>>>>>>>>>>>> http://thegordian.blogspot.com
>>>>>>>>>>>>>>>>>> http://twitter.com/eikestepper
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Am 24.05.2011 09:25, schrieb Christophe Bouhier:
>>>>>>>>>>>>>>>>>>> Hi, We have a requirement to log activity per user. So this could be
>>>>>>>>>>>>>>>>>>> an object being created, modified or deleted. It could also be a
>>>>>>>>>>>>>>>>>>> reference being created, modified or deleted. Is there a capability in
>>>>>>>>>>>>>>>>>>> CDO to do this (Server side), perhaps linking a CDOSession and CDOView ?
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Thanks Christophe
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:(no subject)
Next Topic:An emf uuid question
Goto Forum:
  


Current Time: Thu Sep 19 08:29:55 GMT 2019

Powered by FUDForum. Page generated in 0.05828 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top