Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Once again Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl]
Once again Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl] [message #1060537] Sun, 26 May 2013 12:24 Go to next message
bobby car is currently offline bobby carFriend
Messages: 2
Registered: May 2013
Junior Member
i know there are already a few threads about this error, but none of them solved my problem.

i built a standalone server and client (without eclipse, launch-files or something else, just by calling the server/client class) based on examples by Eike Stepper:
- server: http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/Server.java
- client: http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java

i attached a picture with my included plugins (for the server). i already included 'org.eclipse.emf.cdo.server.ocl_4.0.0.v20120911-1146.jar' (as mentioned in other threads) and in the osgi-terminal it is marked as resovled.

i also tested the precompiled server from 'emf-cdo-R20130213-0014-CDOServer-Linux.zip' (also added the ...server.ocl-jar) and i got the same error.


the request of my client which causes the error looks like that:
// the connection is create like in the example above
CDOTransaction transaction = s.openTransaction();
CDOQuery cqo = transaction.createQuery("ocl", "Company.allInstances()");
final List<Company> companies = cqo.getResult(Company.class);
int size = companies.size();


The error trace from the server looks like:
[ERROR] Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl]
org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl]
	at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:200)
	at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:534)
	at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:292)
	at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:273)
	at org.eclipse.emf.cdo.spi.server.ContainerQueryHandlerProvider.getQueryHandler(ContainerQueryHandlerProvider.java:42)
	at org.eclipse.emf.cdo.internal.server.Repository.getQueryHandler(Repository.java:977)
	at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:293)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)


Has anybody some ideas? Did i miss any dependency or something?
  • Attachment: cdo.png
    (Size: 118.04KB, Downloaded 112 times)
Re: Once again Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl] [message #1060670 is a reply to message #1060537] Mon, 27 May 2013 15:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6381
Registered: July 2009
Senior Member
Am 27.05.2013 14:34, schrieb bobby car:
> i know there are already a few threads about this error, but none of them solved my problem.
>
> i built a standalone server
A standalone server needs to register the needed factory via:

OCLQueryHandler.prepareContainer(IPluginContainer.INSTANCE);

Cheers
/Eike

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


> and client (without eclipse, launch-files or something else, just by calling the server/client class) based on examples by Eike Stepper:
> - server: http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/Server.java
> - client: http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java
>
> i attached a picture with my included plugins (for the server). i already included 'org.eclipse.emf.cdo.server.ocl_4.0.0.v20120911-1146.jar' (as mentioned in other threads) and in the osgi-terminal it is marked as resovled.
>
> i also tested the precompiled server from 'emf-cdo-R20130213-0014-CDOServer-Linux.zip' (also added the ...server.ocl-jar) and i got the same error.
>
>
> the request of my client which causes the error looks like that:
>
> // the connection is create like in the example above
> CDOTransaction transaction = s.openTransaction();
> CDOQuery cqo = transaction.createQuery("ocl", "Company.allInstances()");
> final List<Company> companies = cqo.getResult(Company.class);
> int size = companies.size();
>
>
> The error trace from the server looks like:
> [ERROR] Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl]
> org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl]
> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:200)
> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:534)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:292)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:273)
> at org.eclipse.emf.cdo.spi.server.ContainerQueryHandlerProvider.getQueryHandler(ContainerQueryHandlerProvider.java:42)
> at org.eclipse.emf.cdo.internal.server.Repository.getQueryHandler(Repository.java:977)
> at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:293)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:722)
>
> Has anybody some ideas? Did i miss any dependency or something?
Re: Once again Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl] [message #1060682 is a reply to message #1060670] Mon, 27 May 2013 17:36 Go to previous messageGo to next message
bobby car is currently offline bobby carFriend
Messages: 2
Registered: May 2013
Junior Member
OCLQueryHandler.prepareContainer(IPluginContainer.INSTANCE);

that and a few more dependencies seem to fix my problem

Thanks Eike
Re: Once again Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl] [message #1730751 is a reply to message #1060682] Thu, 28 April 2016 09:28 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
Hi,

I'm facing the same problem while performing junit tests based on a h2 memstore.
I followed the tip of this topic and also had a look to 'org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig' with no success Sad.

The following plug-ins are declared as required :
- org.eclipse.emf.cdo.server.ocl
- org.eclipse.ocl.ecore

And running my test against a deployed repository based on a classical h2 db store is ok.

Can anybody help me figure out what is wrong with the following configuration used in my test ?

Map<String, String> props = new HashMap<String, String>();
props.put(IRepository.Props.OVERRIDE_UUID, "");
props.put(IRepository.Props.SUPPORTING_AUDITS, "false");
props.put(IRepository.Props.SUPPORTING_BRANCHES, "false");
props.put(IRepository.Props.ENSURE_REFERENTIAL_INTEGRITY, "false");
IRepository repository = CDOServerUtil.createRepository(REPOSITORY_NAME, MEMStoreUtil.createMEMStore(), props);

container = ContainerUtil.createContainer();
OCLQueryHandler.prepareContainer(container); // Needed for issuing OCL queries
Net4jUtil.prepareContainer(container);
CDONet4jUtil.prepareContainer(container);
CDONet4jServerUtil.prepareContainer(container);
TCPUtil.prepareContainer(container);
container.activate();
TCPUtil.getAcceptor(container, URI);

CDOServerUtil.addRepository(container, repository);

connector = TCPUtil.getConnector(container, URI);
CDONet4jSessionConfiguration sessionConfig = CDONet4jUtil.createNet4jSessionConfiguration();
sessionConfig.setConnector(connector);
sessionConfig.setRepositoryName(REPOSITORY_NAME);
featureSession = sessionConfig.openNet4jSession();
concurrentSession = sessionConfig.openNet4jSession();
...


Kind regards,

Laurent
Re: Once again Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl] [message #1730944 is a reply to message #1730751] Sat, 30 April 2016 14:09 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6381
Registered: July 2009
Senior Member
Am 28.04.2016 um 11:28 schrieb Laurent Le Moux:
> Hi,
>
> I'm facing the same problem while performing junit tests based on a h2 memstore.
> I followed the tip of this topic and also had a look to 'org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig' with
> no success :(.
>
> The following plug-ins are declared as required :
> - org.eclipse.emf.cdo.server.ocl
> - org.eclipse.ocl.ecore
>
> And running my test against a deployed repository based on a classical h2 db store is ok.
>
> Can anybody help me figure out what is wrong with the following configuration used in my test ?
>
>
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, "");
> props.put(IRepository.Props.SUPPORTING_AUDITS, "false");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "false");
> props.put(IRepository.Props.ENSURE_REFERENTIAL_INTEGRITY, "false");
> IRepository repository = CDOServerUtil.createRepository(REPOSITORY_NAME, MEMStoreUtil.createMEMStore(), props);
>
> container = ContainerUtil.createContainer();
Please try the following instead:

container = IPluginContainer.INSTANCE;

Does that work?

Cheers
/Eike


> OCLQueryHandler.prepareContainer(container); // Needed for issuing OCL queries
> Net4jUtil.prepareContainer(container);
> CDONet4jUtil.prepareContainer(container);
> CDONet4jServerUtil.prepareContainer(container);
> TCPUtil.prepareContainer(container);
> container.activate();
> TCPUtil.getAcceptor(container, URI);
>
> CDOServerUtil.addRepository(container, repository);
>
> connector = TCPUtil.getConnector(container, URI);
> CDONet4jSessionConfiguration sessionConfig = CDONet4jUtil.createNet4jSessionConfiguration();
> sessionConfig.setConnector(connector);
> sessionConfig.setRepositoryName(REPOSITORY_NAME);
> featureSession = sessionConfig.openNet4jSession();
> concurrentSession = sessionConfig.openNet4jSession();
> ..
>
>
> Kind regards,
>
> Laurent
Re: Once again Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl] [message #1730952 is a reply to message #1730944] Sat, 30 April 2016 15:31 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
It was as simple as that...
Thank you Eike !
Re: Once again Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl] [message #1730971 is a reply to message #1730952] Sun, 01 May 2016 08:21 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6381
Registered: July 2009
Senior Member
Hi Laurent,

I looked at it again and propose the following addition to CDOServerUtil.addRepository() :

InternalRepository internal = (InternalRepository)repository;
if (internal.getContainer() == null)
{
internal.setContainer(container);
}

With that code added you could use your own container instance and the repo's query handler provider would use it to
look up the query handlers. Can you please submit a bugzilla for this?

Cheers
/Eike


Am 30.04.2016 um 17:31 schrieb Laurent Le Moux:
> It was as simple as that...
> Thank you Eike !
Re: Once again Factory not found: org.eclipse.emf.cdo.server.queryHandlerFactories[ocl] [message #1731012 is a reply to message #1730971] Mon, 02 May 2016 07:38 Go to previous message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
Hi Eike,

It's done : https://bugs.eclipse.org/bugs/show_bug.cgi?id=492791

Regards,

Laurent
Previous Topic:[CDO] CDOLazyContentAdapter does not attach to CDOResourceFolder
Next Topic:Ecore meta-model formal documentation?
Goto Forum:
  


Current Time: Wed Jun 20 21:15:51 GMT 2018

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

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

Back to the top