You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Jens Hübel <jh...@opentext.com> on 2011/08/03 13:01:38 UTC

CMIS and Lucene

Hi Chemistries,

 

is anyone of us already involved in the Lucene project?

 

Reading this here http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests

 

I think it would make sense to give them an introduction to what we have.

 

if I understand this correctly one of the options they discuss is to create an InMemory mock server. It does not make much sense to duplicate what we already have (and if we need getContentChanges() for that I am happy to implement this).

 

Jens

 


Re: CMIS and Lucene

Posted by Florian Müller <fl...@alfresco.com>.
We have a Maven/Jetty setup for the OpenCMIS integration tests, which works. 
Maybe you can spot the difference by looking at the pom:
/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml

The cause of the ClassCastException is that it falls back to the JAX-WS implementation in the JRE, which incompatible with OpenCMIS.
You have to have a newer JAX-WS implementation in the classpath.


Florian

On 03/08/2011 16:10, Piergiorgio Lucidi wrote:
> The only difference between the two versions of the war of the InMemory
> Repository is that in the 0.4.0 (that works fine on Jetty) there are two
> more dependencies:
> 
> - jsr181-api-1.0-MR1.jar
> - jsr250-api-1.0.jar
> 
> Could be the deployment problem caused by this lack?
> If yes, it could be fixed reincluding this file in the building process of
> the webapp.
> 
> 2011/8/3 Piergiorgio Lucidi <pi...@gmail.com>
> 
>> Hi Florian,
>>
>> thank you for your suggestion but trying to deploy the InMemory Repository
>> webapp on Tomcat works fine.
>> It seems that there is a problem only on Jetty, maybe later I will try to
>> add other dependencies and I'll let you know.
>>
>> Now I'm trying with the 0.5.0-SNAPSHOT but without any result.
>>
>> 2011/8/3 Florian Müller <fl...@alfresco.com>
>>
>>> Hi,
>>>
>>> Make sure that you have all OpenCMIS dependencies in your classpath.
>>>
>>>
>>> Florian
>>>
>>> On 03/08/2011 15:44, Piergiorgio Lucidi wrote:
>>>> Building the latest version of the code in the trunk, the InMemory
>>>> Repository can't deploy anymore, it returns this exception trying
>>> deploying
>>>> on Jetty:
>>>>
>>>>  GRAVE: WSSERVLET11: failed to parse runtime descriptor:
>>>>> com.sun.xml.ws.util.ServiceConfigurationError:
>>>>> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
>>>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
>>>>> is specified in
>>>>>
>>> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
>>>>> could not be instantiated: java.lang.ClassCastException
>>>>> com.sun.xml.ws.util.ServiceConfigurationError:
>>>>> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
>>>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
>>>>> is specified in
>>>>>
>>> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
>>>>> could not be instantiated: java.lang.ClassCastException
>>>>> at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:233)
>>>>> at com.sun.xml.ws.util.ServiceFinder.access$300(ServiceFinder.java:141)
>>>>> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
>>>>> ServiceFinder.java:379)
>>>>> at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory.create(
>>>>> TubelineAssemblerFactory.java:104)
>>>>> at com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:147)
>>>>> at com.sun.xml.ws.server.EndpointFactory.createEndpoint(
>>>>> EndpointFactory.java:218)
>>>>> at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
>>>>> at
>>> com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(
>>>>> DeploymentDescriptorParser.java:253)
>>>>> at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(
>>>>> DeploymentDescriptorParser.java:147)
>>>>> at
>>>>>
>>> com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(
>>>>> WSServletContextListener.java:108)
>>>>> at org.mortbay.jetty.handler.ContextHandler.startContext(
>>>>> ContextHandler.java:549)
>>>>> at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
>>>>> at org.mortbay.jetty.webapp.WebAppContext.startContext(
>>>>> WebAppContext.java:1282)
>>>>> at org.mortbay.jetty.handler.ContextHandler.doStart(
>>>>> ContextHandler.java:518)
>>>>> at
>>> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
>>>>> at
>>> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>>>>> )
>>>>> at org.mortbay.jetty.handler.HandlerCollection.doStart(
>>>>> HandlerCollection.java:152)
>>>>> at
>>> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>>>>> )
>>>>> at org.mortbay.jetty.handler.HandlerWrapper.doStart(
>>>>> HandlerWrapper.java:130)
>>>>> at org.mortbay.jetty.Server.doStart(Server.java:224)
>>>>> at
>>> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>>>>> )
>>>>> at org.apache.manifoldcf.cmis_tests.Base.setUp(Base.java:333)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(
>>>>> NativeMethodAccessorImpl.java:39)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>>>>> DelegatingMethodAccessorImpl.java:25)
>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>>>>> FrameworkMethod.java:44)
>>>>> at org.junit.internal.runners.model.ReflectiveCallable.run(
>>>>> ReflectiveCallable.java:15)
>>>>> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>>>>> FrameworkMethod.java:41)
>>>>> at org.junit.internal.runners.statements.RunBefores.evaluate(
>>>>> RunBefores.java:27)
>>>>> at org.junit.internal.runners.statements.RunAfters.evaluate(
>>>>> RunAfters.java:31)
>>>>> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>>>>> BlockJUnit4ClassRunner.java:79)
>>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>>>>> BlockJUnit4ClassRunner.java:71)
>>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>>>>> BlockJUnit4ClassRunner.java:49)
>>>>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>>>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>>>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>>>> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>>>>> JUnit4TestReference.java:49)
>>>>> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>>>>> TestExecution.java:38)
>>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>>>>> RemoteTestRunner.java:467)
>>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>>>>> RemoteTestRunner.java:683)
>>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>>>>> RemoteTestRunner.java:390)
>>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>>>>> RemoteTestRunner.java:197)
>>>>> Caused by: java.lang.ClassCastException
>>>>> at java.lang.Class.cast(Class.java:2990)
>>>>> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
>>>>> ServiceFinder.java:374)
>>>>> ... 43 more
>>>>
>>>>
>>>>
>>>> 2011/8/3 Piergiorgio Lucidi <pi...@gmail.com>
>>>>
>>>>> I'm building OpenCMIS to investigate me too :-P
>>>>>
>>>>>
>>>>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>>>>
>>>>>> Thanks for posting! I will try to rebuild and take a look why it does
>>> not
>>>>>> work. To get further information I need the server logs, but with your
>>> code
>>>>>> I can debug it.
>>>>>>
>>>>>> Jens
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>>>>>> Sent: Mittwoch, 3. August 2011 14:48
>>>>>> To: dev@chemistry.apache.org
>>>>>> Subject: Re: CMIS and Lucene
>>>>>>
>>>>>> Hi Jens,
>>>>>>
>>>>>> here the code of my integration test that is used to create some
>>> content
>>>>>> in
>>>>>> the InMemory Repository, the OpenCMIS server is running because it is
>>>>>> bootstrapped by Jetty / Maven. The CMIS Repository Connector works
>>> fine
>>>>>> with
>>>>>> Alfresco 3.4d Community, but I would like to have the OpenCMIS server
>>> in
>>>>>> the
>>>>>> test suite.
>>>>>>
>>>>>> In the following snippet I started to initialize the test environment
>>> with
>>>>>> a
>>>>>> new folder with a new content, here I don't have any problem, it works
>>>>>> with
>>>>>> the InMemory Repository:
>>>>>>
>>>>>>  private Session getCmisClientSession(){
>>>>>>>     // default factory implementation
>>>>>>>     SessionFactory factory = SessionFactoryImpl.newInstance();
>>>>>>>     Map<String, String> parameters = new HashMap<String, String>();
>>>>>>>     // user credentials
>>>>>>>     parameters.put(SessionParameter.USER, "dummyuser");
>>>>>>>     parameters.put(SessionParameter.PASSWORD, "dummysecret");
>>>>>>>     // connection settings
>>>>>>>     parameters.put(SessionParameter.ATOMPUB_URL,
>>>>>> CMIS_ENDPOINT_TEST_SERVER
>>>>>>> );
>>>>>>>     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
>>>>>>> .value());
>>>>>>>     // create session
>>>>>>>     return
>>> factory.getRepositories(parameters).get(0).createSession();
>>>>>>>   }
>>>>>>>  @Before
>>>>>>>   public void createTestArea()
>>>>>>>     throws Exception
>>>>>>>   {
>>>>>>>     try
>>>>>>>     {
>>>>>>>       Session session = getCmisClientSession();
>>>>>>>       //creating a new folder
>>>>>>>       Folder root = session.getRootFolder();
>>>>>>>       Map<String, Object> folderProperties = new HashMap<String,
>>>>>>> Object>();
>>>>>>>       folderProperties.put(PropertyIds.OBJECT_TYPE_ID,
>>> "cmis:folder");
>>>>>>>       folderProperties.put(PropertyIds.NAME, "testdata");
>>>>>>>
>>>>>>>       Folder newFolder = root.createFolder(folderProperties);
>>>>>>>       //create a new content in the folder
>>>>>>>       String name = "testdata1.txt";
>>>>>>>       // properties
>>>>>>>       // (minimal set: name and object type id)
>>>>>>>       Map<String, Object> contentProperties = new HashMap<String,
>>>>>>> Object>();
>>>>>>>       contentProperties.put(PropertyIds.OBJECT_TYPE_ID,
>>>>>> "cmis:document");
>>>>>>>       contentProperties.put(PropertyIds.NAME, name);
>>>>>>>
>>>>>>>       // content
>>>>>>>       byte[] content = "CMIS Testdata One".getBytes();
>>>>>>>       InputStream stream = new ByteArrayInputStream(content);
>>>>>>>       ContentStream contentStream = new ContentStreamImpl(name,
>>>>>> newBigInteger(content),
>>>>>>> "text/plain", stream);
>>>>>>>
>>>>>>>        // create a major version
>>>>>>>       Document newContent1 =
>>> newFolder.createDocument(contentProperties,
>>>>>>> contentStream, null);
>>>>>>
>>>>>>
>>>>>> But if I try to search the new content in the InMemory Repository, in
>>> the
>>>>>> same way I implemented in the CMIS Repository Connector:
>>>>>>
>>>>>>  ItemIterable<QueryResult> results = session.query("SELECT * FROM
>>>>>>> cmis:folder WHERE cmis:name='testdata'", false);
>>>>>>>       for (QueryResult result : results) {
>>>>>>>         String id =
>>> result.getPropertyValueById(PropertyIds.OBJECT_ID);
>>>>>>>       }
>>>>>>
>>>>>>
>>>>>>
>>>>>> It returns the following exception:
>>>>>>
>>>>>>
>>>  org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
>>>>>> null
>>>>>>> at
>>>>>>>
>>>>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
>>>>>>> AbstractAtomPubService.java:450)
>>>>>>> at
>>>>>>>
>>>>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
>>>>>>> AbstractAtomPubService.java:568)
>>>>>>> at
>>>>>>>
>>>>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
>>>>>>> DiscoveryServiceImpl.java:141)
>>>>>>> at
>>> org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
>>>>>>> SessionImpl.java:557)
>>>>>>> at
>>>>>>>
>>>>>>
>>> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
>>>>>>> AbstractIterator.java:132)
>>>>>>> at
>>>>>>>
>>>>>>
>>> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
>>>>>>> CollectionIterator.java:48)
>>>>>>> at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
>>>>>>> APISanityTest.java:139)
>>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(
>>>>>>> NativeMethodAccessorImpl.java:39)
>>>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>>>>>>> DelegatingMethodAccessorImpl.java:25)
>>>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>>> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>>>>>>> FrameworkMethod.java:44)
>>>>>>> at org.junit.internal.runners.model.ReflectiveCallable.run(
>>>>>>> ReflectiveCallable.java:15)
>>>>>>> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>>>>>>> FrameworkMethod.java:41)
>>>>>>> at org.junit.internal.runners.statements.RunBefores.evaluate(
>>>>>>> RunBefores.java:27)
>>>>>>> at org.junit.internal.runners.statements.RunAfters.evaluate(
>>>>>>> RunAfters.java:31)
>>>>>>> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>>>>>>> BlockJUnit4ClassRunner.java:79)
>>>>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>>>>>>> BlockJUnit4ClassRunner.java:71)
>>>>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>>>>>>> BlockJUnit4ClassRunner.java:49)
>>>>>>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>>>>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>>>>>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>>>>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>>>>>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>>>>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>>>>>> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>>>>>>> JUnit4TestReference.java:49)
>>>>>>> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>>>>>>> TestExecution.java:38)
>>>>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>>>>>>> RemoteTestRunner.java:467)
>>>>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>>>>>>> RemoteTestRunner.java:683)
>>>>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>>>>>>> RemoteTestRunner.java:390)
>>>>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>>>>>>> RemoteTestRunner.java:197)
>>>>>>
>>>>>>
>>>>>> Let me know if you have any hints!
>>>>>>
>>>>>> Thank you again for your support.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Piergiorgio
>>>>>>
>>>>>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>>>>>
>>>>>>> Hi Pergiorio,
>>>>>>>
>>>>>>> do you have a code piece that I can take a look at? What is your
>>> client
>>>>>>> API? Do you connect to Chemistry client API
>>>>>> (chemistry-opencmis-client-api)?
>>>>>>> Or perhaps you can grab the query sent from the log file?
>>>>>>>
>>>>>>> Thanks Jens
>>>>>>>
>>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>>>>>>> Sent: Mittwoch, 3. August 2011 13:22
>>>>>>> To: dev@chemistry.apache.org
>>>>>>> Subject: Re: CMIS and Lucene
>>>>>>>
>>>>>>> Hi Jens,
>>>>>>>
>>>>>>> I contributed to the Apache ManifoldCF (ex Lucene Connector
>>> Framework)
>>>>>>> project implementing the CMIS Connector using OpenCMIS 0.4.0.
>>>>>>>
>>>>>>> Now I'm working on integration test trying to use the OpenCMIS
>>> InMemory
>>>>>>> Repository that is available from Apache Chemistry ;)
>>>>>>>
>>>>>>> I have some problems because now I'm finishing my test implementation
>>>>>> but
>>>>>>> it
>>>>>>> seems that I can't execute queries on the InMemory Repository, it
>>>>>> returns a
>>>>>>> null string in the convertStatusCode method.
>>>>>>>
>>>>>>> The CMIS Repository Connector that I implemented for ManifoldCF has a
>>>>>> job
>>>>>>> parameter that is the CMIS Query, this parameter is used by agents to
>>>>>>> select
>>>>>>> all the contents that needs to be indexed on the Output Connector
>>> (for
>>>>>>> example Apache Solr).
>>>>>>> Without a query feature exposed by the InMemory Repository I can't
>>> test
>>>>>> the
>>>>>>> connector in the right way.
>>>>>>>
>>>>>>> I tried to use the latest version of the InMemory Repository
>>>>>>> (0.5.0-SNAPSHOT) but with the same result.
>>>>>>>
>>>>>>> Have you got any ideas to solve this problem?
>>>>>>> Thank you for your support.
>>>>>>>
>>>>>>> Regards,
>>>>>>> Piergiorgio
>>>>>>>
>>>>>>>
>>>>>>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>>>>>>
>>>>>>>> Hi Chemistries,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> is anyone of us already involved in the Lucene project?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Reading this here
>>>>>>>> http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I think it would make sense to give them an introduction to what we
>>>>>> have.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> if I understand this correctly one of the options they discuss is to
>>>>>>> create
>>>>>>>> an InMemory mock server. It does not make much sense to duplicate
>>> what
>>>>>> we
>>>>>>>> already have (and if we need getContentChanges() for that I am happy
>>>>>> to
>>>>>>>> implement this).
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Jens
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Piergiorgio Lucidi
>>>>>>> Web: http://about.me/piergiorgiolucidi
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Piergiorgio Lucidi
>>>>>> Web: http://about.me/piergiorgiolucidi
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Piergiorgio Lucidi
>>>>> Web: http://about.me/piergiorgiolucidi
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>> --
>> Piergiorgio Lucidi
>> Web: http://about.me/piergiorgiolucidi
>>
>>
> 
> 


Re: CMIS and Lucene

Posted by Piergiorgio Lucidi <pi...@gmail.com>.
Trying to use the snippet (executing the query) that I have shown before
against the InMemory Repository 0.5.0-SNAPSHOT (build from the latest code
in the SVN) and correctly deployed on Apache Tomcat, it returns the
following null pointer exception:

GRAVE: null
> org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException
> at
> org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:93)
>  at
> org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.dispatch(CmisAtomPubServlet.java:217)
> at
> org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.service(CmisAtomPubServlet.java:166)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>  at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>  at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
>  at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>  at java.lang.Thread.run(Thread.java:680)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>  at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:86)
>  ... 15 more
> Caused by: java.lang.NullPointerException
> at
> org.apache.chemistry.opencmis.inmemory.query.InMemoryQueryProcessor.compareTo(InMemoryQueryProcessor.java:630)
>  at
> org.apache.chemistry.opencmis.inmemory.query.InMemoryQueryProcessor$InMemoryWhereClauseWalker.compareTo(InMemoryQueryProcessor.java:531)
> at
> org.apache.chemistry.opencmis.inmemory.query.InMemoryQueryProcessor$InMemoryWhereClauseWalker.walkEquals(InMemoryQueryProcessor.java:303)
>  at
> org.apache.chemistry.opencmis.server.support.query.AbstractPredicateWalker.walkPredicate(AbstractPredicateWalker.java:46)
> at
> org.apache.chemistry.opencmis.inmemory.query.InMemoryQueryProcessor.evalWhereNode(InMemoryQueryProcessor.java:268)
>  at
> org.apache.chemistry.opencmis.inmemory.query.InMemoryQueryProcessor.evalWhereTree(InMemoryQueryProcessor.java:250)
> at
> org.apache.chemistry.opencmis.inmemory.query.InMemoryQueryProcessor.match(InMemoryQueryProcessor.java:243)
>  at
> org.apache.chemistry.opencmis.inmemory.query.InMemoryQueryProcessor.query(InMemoryQueryProcessor.java:98)
> at
> org.apache.chemistry.opencmis.inmemory.storedobj.impl.StoreManagerImpl.query(StoreManagerImpl.java:394)
>  at
> org.apache.chemistry.opencmis.inmemory.server.InMemoryDiscoveryServiceImpl.query(InMemoryDiscoveryServiceImpl.java:112)
> at
> org.apache.chemistry.opencmis.inmemory.server.InMemoryService.query(InMemoryService.java:355)
>  at
> org.apache.chemistry.opencmis.server.impl.atompub.DiscoveryService.query(DiscoveryService.java:126)
> ... 20 more




2011/8/3 Piergiorgio Lucidi <pi...@gmail.com>

> The only difference between the two versions of the war of the InMemory
> Repository is that in the 0.4.0 (that works fine on Jetty) there are two
> more dependencies:
>
> - jsr181-api-1.0-MR1.jar
> - jsr250-api-1.0.jar
>
> Could be the deployment problem caused by this lack?
> If yes, it could be fixed reincluding this file in the building process of
> the webapp.
>
> 2011/8/3 Piergiorgio Lucidi <pi...@gmail.com>
>
>> Hi Florian,
>>
>> thank you for your suggestion but trying to deploy the InMemory Repository
>> webapp on Tomcat works fine.
>> It seems that there is a problem only on Jetty, maybe later I will try to
>> add other dependencies and I'll let you know.
>>
>> Now I'm trying with the 0.5.0-SNAPSHOT but without any result.
>>
>> 2011/8/3 Florian Müller <fl...@alfresco.com>
>>
>>> Hi,
>>>
>>> Make sure that you have all OpenCMIS dependencies in your classpath.
>>>
>>>
>>> Florian
>>>
>>> On 03/08/2011 15:44, Piergiorgio Lucidi wrote:
>>> > Building the latest version of the code in the trunk, the InMemory
>>> > Repository can't deploy anymore, it returns this exception trying
>>> deploying
>>> > on Jetty:
>>> >
>>> >  GRAVE: WSSERVLET11: failed to parse runtime descriptor:
>>> >> com.sun.xml.ws.util.ServiceConfigurationError:
>>> >> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
>>> >>
>>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
>>> >> is specified in
>>> >>
>>> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
>>> >> could not be instantiated: java.lang.ClassCastException
>>> >> com.sun.xml.ws.util.ServiceConfigurationError:
>>> >> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
>>> >>
>>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
>>> >> is specified in
>>> >>
>>> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
>>> >> could not be instantiated: java.lang.ClassCastException
>>> >> at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:233)
>>> >> at
>>> com.sun.xml.ws.util.ServiceFinder.access$300(ServiceFinder.java:141)
>>> >> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
>>> >> ServiceFinder.java:379)
>>> >> at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory.create(
>>> >> TubelineAssemblerFactory.java:104)
>>> >> at
>>> com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:147)
>>> >> at com.sun.xml.ws.server.EndpointFactory.createEndpoint(
>>> >> EndpointFactory.java:218)
>>> >> at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
>>> >> at
>>> com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(
>>> >> DeploymentDescriptorParser.java:253)
>>> >> at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(
>>> >> DeploymentDescriptorParser.java:147)
>>> >> at
>>> >>
>>> com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(
>>> >> WSServletContextListener.java:108)
>>> >> at org.mortbay.jetty.handler.ContextHandler.startContext(
>>> >> ContextHandler.java:549)
>>> >> at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
>>> >> at org.mortbay.jetty.webapp.WebAppContext.startContext(
>>> >> WebAppContext.java:1282)
>>> >> at org.mortbay.jetty.handler.ContextHandler.doStart(
>>> >> ContextHandler.java:518)
>>> >> at
>>> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
>>> >> at
>>> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>>> >> )
>>> >> at org.mortbay.jetty.handler.HandlerCollection.doStart(
>>> >> HandlerCollection.java:152)
>>> >> at
>>> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>>> >> )
>>> >> at org.mortbay.jetty.handler.HandlerWrapper.doStart(
>>> >> HandlerWrapper.java:130)
>>> >> at org.mortbay.jetty.Server.doStart(Server.java:224)
>>> >> at
>>> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>>> >> )
>>> >> at org.apache.manifoldcf.cmis_tests.Base.setUp(Base.java:333)
>>> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> >> at sun.reflect.NativeMethodAccessorImpl.invoke(
>>> >> NativeMethodAccessorImpl.java:39)
>>> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>>> >> DelegatingMethodAccessorImpl.java:25)
>>> >> at java.lang.reflect.Method.invoke(Method.java:597)
>>> >> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>>> >> FrameworkMethod.java:44)
>>> >> at org.junit.internal.runners.model.ReflectiveCallable.run(
>>> >> ReflectiveCallable.java:15)
>>> >> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>>> >> FrameworkMethod.java:41)
>>> >> at org.junit.internal.runners.statements.RunBefores.evaluate(
>>> >> RunBefores.java:27)
>>> >> at org.junit.internal.runners.statements.RunAfters.evaluate(
>>> >> RunAfters.java:31)
>>> >> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>>> >> BlockJUnit4ClassRunner.java:79)
>>> >> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>>> >> BlockJUnit4ClassRunner.java:71)
>>> >> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>>> >> BlockJUnit4ClassRunner.java:49)
>>> >> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>> >> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>> >> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>> >> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>> >> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>> >> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>> >> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>>> >> JUnit4TestReference.java:49)
>>> >> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>>> >> TestExecution.java:38)
>>> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>>> >> RemoteTestRunner.java:467)
>>> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>>> >> RemoteTestRunner.java:683)
>>> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>>> >> RemoteTestRunner.java:390)
>>> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>>> >> RemoteTestRunner.java:197)
>>> >> Caused by: java.lang.ClassCastException
>>> >> at java.lang.Class.cast(Class.java:2990)
>>> >> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
>>> >> ServiceFinder.java:374)
>>> >> ... 43 more
>>> >
>>> >
>>> >
>>> > 2011/8/3 Piergiorgio Lucidi <pi...@gmail.com>
>>> >
>>> >> I'm building OpenCMIS to investigate me too :-P
>>> >>
>>> >>
>>> >> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>> >>
>>> >>> Thanks for posting! I will try to rebuild and take a look why it does
>>> not
>>> >>> work. To get further information I need the server logs, but with
>>> your code
>>> >>> I can debug it.
>>> >>>
>>> >>> Jens
>>> >>>
>>> >>> -----Original Message-----
>>> >>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>>> >>> Sent: Mittwoch, 3. August 2011 14:48
>>> >>> To: dev@chemistry.apache.org
>>> >>> Subject: Re: CMIS and Lucene
>>> >>>
>>> >>> Hi Jens,
>>> >>>
>>> >>> here the code of my integration test that is used to create some
>>> content
>>> >>> in
>>> >>> the InMemory Repository, the OpenCMIS server is running because it is
>>> >>> bootstrapped by Jetty / Maven. The CMIS Repository Connector works
>>> fine
>>> >>> with
>>> >>> Alfresco 3.4d Community, but I would like to have the OpenCMIS server
>>> in
>>> >>> the
>>> >>> test suite.
>>> >>>
>>> >>> In the following snippet I started to initialize the test environment
>>> with
>>> >>> a
>>> >>> new folder with a new content, here I don't have any problem, it
>>> works
>>> >>> with
>>> >>> the InMemory Repository:
>>> >>>
>>> >>>  private Session getCmisClientSession(){
>>> >>>>     // default factory implementation
>>> >>>>     SessionFactory factory = SessionFactoryImpl.newInstance();
>>> >>>>     Map<String, String> parameters = new HashMap<String, String>();
>>> >>>>     // user credentials
>>> >>>>     parameters.put(SessionParameter.USER, "dummyuser");
>>> >>>>     parameters.put(SessionParameter.PASSWORD, "dummysecret");
>>> >>>>     // connection settings
>>> >>>>     parameters.put(SessionParameter.ATOMPUB_URL,
>>> >>> CMIS_ENDPOINT_TEST_SERVER
>>> >>>> );
>>> >>>>     parameters.put(SessionParameter.BINDING_TYPE,
>>> BindingType.ATOMPUB
>>> >>>> .value());
>>> >>>>     // create session
>>> >>>>     return
>>> factory.getRepositories(parameters).get(0).createSession();
>>> >>>>   }
>>> >>>>  @Before
>>> >>>>   public void createTestArea()
>>> >>>>     throws Exception
>>> >>>>   {
>>> >>>>     try
>>> >>>>     {
>>> >>>>       Session session = getCmisClientSession();
>>> >>>>       //creating a new folder
>>> >>>>       Folder root = session.getRootFolder();
>>> >>>>       Map<String, Object> folderProperties = new HashMap<String,
>>> >>>> Object>();
>>> >>>>       folderProperties.put(PropertyIds.OBJECT_TYPE_ID,
>>> "cmis:folder");
>>> >>>>       folderProperties.put(PropertyIds.NAME, "testdata");
>>> >>>>
>>> >>>>       Folder newFolder = root.createFolder(folderProperties);
>>> >>>>       //create a new content in the folder
>>> >>>>       String name = "testdata1.txt";
>>> >>>>       // properties
>>> >>>>       // (minimal set: name and object type id)
>>> >>>>       Map<String, Object> contentProperties = new HashMap<String,
>>> >>>> Object>();
>>> >>>>       contentProperties.put(PropertyIds.OBJECT_TYPE_ID,
>>> >>> "cmis:document");
>>> >>>>       contentProperties.put(PropertyIds.NAME, name);
>>> >>>>
>>> >>>>       // content
>>> >>>>       byte[] content = "CMIS Testdata One".getBytes();
>>> >>>>       InputStream stream = new ByteArrayInputStream(content);
>>> >>>>       ContentStream contentStream = new ContentStreamImpl(name,
>>> >>> newBigInteger(content),
>>> >>>> "text/plain", stream);
>>> >>>>
>>> >>>>        // create a major version
>>> >>>>       Document newContent1 =
>>> newFolder.createDocument(contentProperties,
>>> >>>> contentStream, null);
>>> >>>
>>> >>>
>>> >>> But if I try to search the new content in the InMemory Repository, in
>>> the
>>> >>> same way I implemented in the CMIS Repository Connector:
>>> >>>
>>> >>>  ItemIterable<QueryResult> results = session.query("SELECT * FROM
>>> >>>> cmis:folder WHERE cmis:name='testdata'", false);
>>> >>>>       for (QueryResult result : results) {
>>> >>>>         String id =
>>> result.getPropertyValueById(PropertyIds.OBJECT_ID);
>>> >>>>       }
>>> >>>
>>> >>>
>>> >>>
>>> >>> It returns the following exception:
>>> >>>
>>> >>>
>>>  org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
>>> >>> null
>>> >>>> at
>>> >>>>
>>> >>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
>>> >>>> AbstractAtomPubService.java:450)
>>> >>>> at
>>> >>>>
>>> >>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
>>> >>>> AbstractAtomPubService.java:568)
>>> >>>> at
>>> >>>>
>>> >>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
>>> >>>> DiscoveryServiceImpl.java:141)
>>> >>>> at
>>> org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
>>> >>>> SessionImpl.java:557)
>>> >>>> at
>>> >>>>
>>> >>>
>>> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
>>> >>>> AbstractIterator.java:132)
>>> >>>> at
>>> >>>>
>>> >>>
>>> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
>>> >>>> CollectionIterator.java:48)
>>> >>>> at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
>>> >>>> APISanityTest.java:139)
>>> >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> >>>> at sun.reflect.NativeMethodAccessorImpl.invoke(
>>> >>>> NativeMethodAccessorImpl.java:39)
>>> >>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>>> >>>> DelegatingMethodAccessorImpl.java:25)
>>> >>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> >>>> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>>> >>>> FrameworkMethod.java:44)
>>> >>>> at org.junit.internal.runners.model.ReflectiveCallable.run(
>>> >>>> ReflectiveCallable.java:15)
>>> >>>> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>>> >>>> FrameworkMethod.java:41)
>>> >>>> at org.junit.internal.runners.statements.RunBefores.evaluate(
>>> >>>> RunBefores.java:27)
>>> >>>> at org.junit.internal.runners.statements.RunAfters.evaluate(
>>> >>>> RunAfters.java:31)
>>> >>>> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>>> >>>> BlockJUnit4ClassRunner.java:79)
>>> >>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>>> >>>> BlockJUnit4ClassRunner.java:71)
>>> >>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>>> >>>> BlockJUnit4ClassRunner.java:49)
>>> >>>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>> >>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>> >>>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>> >>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>> >>>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>> >>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>> >>>> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>>> >>>> JUnit4TestReference.java:49)
>>> >>>> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>>> >>>> TestExecution.java:38)
>>> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>>> >>>> RemoteTestRunner.java:467)
>>> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>>> >>>> RemoteTestRunner.java:683)
>>> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>>> >>>> RemoteTestRunner.java:390)
>>> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>>> >>>> RemoteTestRunner.java:197)
>>> >>>
>>> >>>
>>> >>> Let me know if you have any hints!
>>> >>>
>>> >>> Thank you again for your support.
>>> >>>
>>> >>> Regards,
>>> >>>
>>> >>> Piergiorgio
>>> >>>
>>> >>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>> >>>
>>> >>>> Hi Pergiorio,
>>> >>>>
>>> >>>> do you have a code piece that I can take a look at? What is your
>>> client
>>> >>>> API? Do you connect to Chemistry client API
>>> >>> (chemistry-opencmis-client-api)?
>>> >>>> Or perhaps you can grab the query sent from the log file?
>>> >>>>
>>> >>>> Thanks Jens
>>> >>>>
>>> >>>>
>>> >>>> -----Original Message-----
>>> >>>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>>> >>>> Sent: Mittwoch, 3. August 2011 13:22
>>> >>>> To: dev@chemistry.apache.org
>>> >>>> Subject: Re: CMIS and Lucene
>>> >>>>
>>> >>>> Hi Jens,
>>> >>>>
>>> >>>> I contributed to the Apache ManifoldCF (ex Lucene Connector
>>> Framework)
>>> >>>> project implementing the CMIS Connector using OpenCMIS 0.4.0.
>>> >>>>
>>> >>>> Now I'm working on integration test trying to use the OpenCMIS
>>> InMemory
>>> >>>> Repository that is available from Apache Chemistry ;)
>>> >>>>
>>> >>>> I have some problems because now I'm finishing my test
>>> implementation
>>> >>> but
>>> >>>> it
>>> >>>> seems that I can't execute queries on the InMemory Repository, it
>>> >>> returns a
>>> >>>> null string in the convertStatusCode method.
>>> >>>>
>>> >>>> The CMIS Repository Connector that I implemented for ManifoldCF has
>>> a
>>> >>> job
>>> >>>> parameter that is the CMIS Query, this parameter is used by agents
>>> to
>>> >>>> select
>>> >>>> all the contents that needs to be indexed on the Output Connector
>>> (for
>>> >>>> example Apache Solr).
>>> >>>> Without a query feature exposed by the InMemory Repository I can't
>>> test
>>> >>> the
>>> >>>> connector in the right way.
>>> >>>>
>>> >>>> I tried to use the latest version of the InMemory Repository
>>> >>>> (0.5.0-SNAPSHOT) but with the same result.
>>> >>>>
>>> >>>> Have you got any ideas to solve this problem?
>>> >>>> Thank you for your support.
>>> >>>>
>>> >>>> Regards,
>>> >>>> Piergiorgio
>>> >>>>
>>> >>>>
>>> >>>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>> >>>>
>>> >>>>> Hi Chemistries,
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>> is anyone of us already involved in the Lucene project?
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>> Reading this here
>>> >>>>>
>>> http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>> I think it would make sense to give them an introduction to what we
>>> >>> have.
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>> if I understand this correctly one of the options they discuss is
>>> to
>>> >>>> create
>>> >>>>> an InMemory mock server. It does not make much sense to duplicate
>>> what
>>> >>> we
>>> >>>>> already have (and if we need getContentChanges() for that I am
>>> happy
>>> >>> to
>>> >>>>> implement this).
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>> Jens
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>
>>> >>>>
>>> >>>> --
>>> >>>> Piergiorgio Lucidi
>>> >>>> Web: http://about.me/piergiorgiolucidi
>>> >>>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> Piergiorgio Lucidi
>>> >>> Web: http://about.me/piergiorgiolucidi
>>> >>>
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Piergiorgio Lucidi
>>> >> Web: http://about.me/piergiorgiolucidi
>>> >>
>>> >>
>>> >
>>> >
>>>
>>>
>>
>>
>> --
>> Piergiorgio Lucidi
>> Web: http://about.me/piergiorgiolucidi
>>
>>
>
>
> --
> Piergiorgio Lucidi
> Web: http://about.me/piergiorgiolucidi
>
>


-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi

Re: CMIS and Lucene

Posted by Piergiorgio Lucidi <pi...@gmail.com>.
The only difference between the two versions of the war of the InMemory
Repository is that in the 0.4.0 (that works fine on Jetty) there are two
more dependencies:

- jsr181-api-1.0-MR1.jar
- jsr250-api-1.0.jar

Could be the deployment problem caused by this lack?
If yes, it could be fixed reincluding this file in the building process of
the webapp.

2011/8/3 Piergiorgio Lucidi <pi...@gmail.com>

> Hi Florian,
>
> thank you for your suggestion but trying to deploy the InMemory Repository
> webapp on Tomcat works fine.
> It seems that there is a problem only on Jetty, maybe later I will try to
> add other dependencies and I'll let you know.
>
> Now I'm trying with the 0.5.0-SNAPSHOT but without any result.
>
> 2011/8/3 Florian Müller <fl...@alfresco.com>
>
>> Hi,
>>
>> Make sure that you have all OpenCMIS dependencies in your classpath.
>>
>>
>> Florian
>>
>> On 03/08/2011 15:44, Piergiorgio Lucidi wrote:
>> > Building the latest version of the code in the trunk, the InMemory
>> > Repository can't deploy anymore, it returns this exception trying
>> deploying
>> > on Jetty:
>> >
>> >  GRAVE: WSSERVLET11: failed to parse runtime descriptor:
>> >> com.sun.xml.ws.util.ServiceConfigurationError:
>> >> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
>> >>
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
>> >> is specified in
>> >>
>> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
>> >> could not be instantiated: java.lang.ClassCastException
>> >> com.sun.xml.ws.util.ServiceConfigurationError:
>> >> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
>> >>
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
>> >> is specified in
>> >>
>> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
>> >> could not be instantiated: java.lang.ClassCastException
>> >> at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:233)
>> >> at com.sun.xml.ws.util.ServiceFinder.access$300(ServiceFinder.java:141)
>> >> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
>> >> ServiceFinder.java:379)
>> >> at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory.create(
>> >> TubelineAssemblerFactory.java:104)
>> >> at com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:147)
>> >> at com.sun.xml.ws.server.EndpointFactory.createEndpoint(
>> >> EndpointFactory.java:218)
>> >> at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
>> >> at
>> com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(
>> >> DeploymentDescriptorParser.java:253)
>> >> at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(
>> >> DeploymentDescriptorParser.java:147)
>> >> at
>> >>
>> com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(
>> >> WSServletContextListener.java:108)
>> >> at org.mortbay.jetty.handler.ContextHandler.startContext(
>> >> ContextHandler.java:549)
>> >> at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
>> >> at org.mortbay.jetty.webapp.WebAppContext.startContext(
>> >> WebAppContext.java:1282)
>> >> at org.mortbay.jetty.handler.ContextHandler.doStart(
>> >> ContextHandler.java:518)
>> >> at
>> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
>> >> at
>> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>> >> )
>> >> at org.mortbay.jetty.handler.HandlerCollection.doStart(
>> >> HandlerCollection.java:152)
>> >> at
>> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>> >> )
>> >> at org.mortbay.jetty.handler.HandlerWrapper.doStart(
>> >> HandlerWrapper.java:130)
>> >> at org.mortbay.jetty.Server.doStart(Server.java:224)
>> >> at
>> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>> >> )
>> >> at org.apache.manifoldcf.cmis_tests.Base.setUp(Base.java:333)
>> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >> at sun.reflect.NativeMethodAccessorImpl.invoke(
>> >> NativeMethodAccessorImpl.java:39)
>> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> >> DelegatingMethodAccessorImpl.java:25)
>> >> at java.lang.reflect.Method.invoke(Method.java:597)
>> >> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>> >> FrameworkMethod.java:44)
>> >> at org.junit.internal.runners.model.ReflectiveCallable.run(
>> >> ReflectiveCallable.java:15)
>> >> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>> >> FrameworkMethod.java:41)
>> >> at org.junit.internal.runners.statements.RunBefores.evaluate(
>> >> RunBefores.java:27)
>> >> at org.junit.internal.runners.statements.RunAfters.evaluate(
>> >> RunAfters.java:31)
>> >> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>> >> BlockJUnit4ClassRunner.java:79)
>> >> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>> >> BlockJUnit4ClassRunner.java:71)
>> >> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>> >> BlockJUnit4ClassRunner.java:49)
>> >> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> >> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> >> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> >> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> >> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> >> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> >> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>> >> JUnit4TestReference.java:49)
>> >> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>> >> TestExecution.java:38)
>> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>> >> RemoteTestRunner.java:467)
>> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>> >> RemoteTestRunner.java:683)
>> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>> >> RemoteTestRunner.java:390)
>> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>> >> RemoteTestRunner.java:197)
>> >> Caused by: java.lang.ClassCastException
>> >> at java.lang.Class.cast(Class.java:2990)
>> >> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
>> >> ServiceFinder.java:374)
>> >> ... 43 more
>> >
>> >
>> >
>> > 2011/8/3 Piergiorgio Lucidi <pi...@gmail.com>
>> >
>> >> I'm building OpenCMIS to investigate me too :-P
>> >>
>> >>
>> >> 2011/8/3 Jens Hübel <jh...@opentext.com>
>> >>
>> >>> Thanks for posting! I will try to rebuild and take a look why it does
>> not
>> >>> work. To get further information I need the server logs, but with your
>> code
>> >>> I can debug it.
>> >>>
>> >>> Jens
>> >>>
>> >>> -----Original Message-----
>> >>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>> >>> Sent: Mittwoch, 3. August 2011 14:48
>> >>> To: dev@chemistry.apache.org
>> >>> Subject: Re: CMIS and Lucene
>> >>>
>> >>> Hi Jens,
>> >>>
>> >>> here the code of my integration test that is used to create some
>> content
>> >>> in
>> >>> the InMemory Repository, the OpenCMIS server is running because it is
>> >>> bootstrapped by Jetty / Maven. The CMIS Repository Connector works
>> fine
>> >>> with
>> >>> Alfresco 3.4d Community, but I would like to have the OpenCMIS server
>> in
>> >>> the
>> >>> test suite.
>> >>>
>> >>> In the following snippet I started to initialize the test environment
>> with
>> >>> a
>> >>> new folder with a new content, here I don't have any problem, it works
>> >>> with
>> >>> the InMemory Repository:
>> >>>
>> >>>  private Session getCmisClientSession(){
>> >>>>     // default factory implementation
>> >>>>     SessionFactory factory = SessionFactoryImpl.newInstance();
>> >>>>     Map<String, String> parameters = new HashMap<String, String>();
>> >>>>     // user credentials
>> >>>>     parameters.put(SessionParameter.USER, "dummyuser");
>> >>>>     parameters.put(SessionParameter.PASSWORD, "dummysecret");
>> >>>>     // connection settings
>> >>>>     parameters.put(SessionParameter.ATOMPUB_URL,
>> >>> CMIS_ENDPOINT_TEST_SERVER
>> >>>> );
>> >>>>     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
>> >>>> .value());
>> >>>>     // create session
>> >>>>     return
>> factory.getRepositories(parameters).get(0).createSession();
>> >>>>   }
>> >>>>  @Before
>> >>>>   public void createTestArea()
>> >>>>     throws Exception
>> >>>>   {
>> >>>>     try
>> >>>>     {
>> >>>>       Session session = getCmisClientSession();
>> >>>>       //creating a new folder
>> >>>>       Folder root = session.getRootFolder();
>> >>>>       Map<String, Object> folderProperties = new HashMap<String,
>> >>>> Object>();
>> >>>>       folderProperties.put(PropertyIds.OBJECT_TYPE_ID,
>> "cmis:folder");
>> >>>>       folderProperties.put(PropertyIds.NAME, "testdata");
>> >>>>
>> >>>>       Folder newFolder = root.createFolder(folderProperties);
>> >>>>       //create a new content in the folder
>> >>>>       String name = "testdata1.txt";
>> >>>>       // properties
>> >>>>       // (minimal set: name and object type id)
>> >>>>       Map<String, Object> contentProperties = new HashMap<String,
>> >>>> Object>();
>> >>>>       contentProperties.put(PropertyIds.OBJECT_TYPE_ID,
>> >>> "cmis:document");
>> >>>>       contentProperties.put(PropertyIds.NAME, name);
>> >>>>
>> >>>>       // content
>> >>>>       byte[] content = "CMIS Testdata One".getBytes();
>> >>>>       InputStream stream = new ByteArrayInputStream(content);
>> >>>>       ContentStream contentStream = new ContentStreamImpl(name,
>> >>> newBigInteger(content),
>> >>>> "text/plain", stream);
>> >>>>
>> >>>>        // create a major version
>> >>>>       Document newContent1 =
>> newFolder.createDocument(contentProperties,
>> >>>> contentStream, null);
>> >>>
>> >>>
>> >>> But if I try to search the new content in the InMemory Repository, in
>> the
>> >>> same way I implemented in the CMIS Repository Connector:
>> >>>
>> >>>  ItemIterable<QueryResult> results = session.query("SELECT * FROM
>> >>>> cmis:folder WHERE cmis:name='testdata'", false);
>> >>>>       for (QueryResult result : results) {
>> >>>>         String id =
>> result.getPropertyValueById(PropertyIds.OBJECT_ID);
>> >>>>       }
>> >>>
>> >>>
>> >>>
>> >>> It returns the following exception:
>> >>>
>> >>>
>>  org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
>> >>> null
>> >>>> at
>> >>>>
>> >>>
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
>> >>>> AbstractAtomPubService.java:450)
>> >>>> at
>> >>>>
>> >>>
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
>> >>>> AbstractAtomPubService.java:568)
>> >>>> at
>> >>>>
>> >>>
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
>> >>>> DiscoveryServiceImpl.java:141)
>> >>>> at
>> org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
>> >>>> SessionImpl.java:557)
>> >>>> at
>> >>>>
>> >>>
>> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
>> >>>> AbstractIterator.java:132)
>> >>>> at
>> >>>>
>> >>>
>> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
>> >>>> CollectionIterator.java:48)
>> >>>> at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
>> >>>> APISanityTest.java:139)
>> >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >>>> at sun.reflect.NativeMethodAccessorImpl.invoke(
>> >>>> NativeMethodAccessorImpl.java:39)
>> >>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> >>>> DelegatingMethodAccessorImpl.java:25)
>> >>>> at java.lang.reflect.Method.invoke(Method.java:597)
>> >>>> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>> >>>> FrameworkMethod.java:44)
>> >>>> at org.junit.internal.runners.model.ReflectiveCallable.run(
>> >>>> ReflectiveCallable.java:15)
>> >>>> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>> >>>> FrameworkMethod.java:41)
>> >>>> at org.junit.internal.runners.statements.RunBefores.evaluate(
>> >>>> RunBefores.java:27)
>> >>>> at org.junit.internal.runners.statements.RunAfters.evaluate(
>> >>>> RunAfters.java:31)
>> >>>> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>> >>>> BlockJUnit4ClassRunner.java:79)
>> >>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>> >>>> BlockJUnit4ClassRunner.java:71)
>> >>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>> >>>> BlockJUnit4ClassRunner.java:49)
>> >>>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> >>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> >>>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> >>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> >>>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> >>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> >>>> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>> >>>> JUnit4TestReference.java:49)
>> >>>> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>> >>>> TestExecution.java:38)
>> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>> >>>> RemoteTestRunner.java:467)
>> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>> >>>> RemoteTestRunner.java:683)
>> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>> >>>> RemoteTestRunner.java:390)
>> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>> >>>> RemoteTestRunner.java:197)
>> >>>
>> >>>
>> >>> Let me know if you have any hints!
>> >>>
>> >>> Thank you again for your support.
>> >>>
>> >>> Regards,
>> >>>
>> >>> Piergiorgio
>> >>>
>> >>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>> >>>
>> >>>> Hi Pergiorio,
>> >>>>
>> >>>> do you have a code piece that I can take a look at? What is your
>> client
>> >>>> API? Do you connect to Chemistry client API
>> >>> (chemistry-opencmis-client-api)?
>> >>>> Or perhaps you can grab the query sent from the log file?
>> >>>>
>> >>>> Thanks Jens
>> >>>>
>> >>>>
>> >>>> -----Original Message-----
>> >>>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>> >>>> Sent: Mittwoch, 3. August 2011 13:22
>> >>>> To: dev@chemistry.apache.org
>> >>>> Subject: Re: CMIS and Lucene
>> >>>>
>> >>>> Hi Jens,
>> >>>>
>> >>>> I contributed to the Apache ManifoldCF (ex Lucene Connector
>> Framework)
>> >>>> project implementing the CMIS Connector using OpenCMIS 0.4.0.
>> >>>>
>> >>>> Now I'm working on integration test trying to use the OpenCMIS
>> InMemory
>> >>>> Repository that is available from Apache Chemistry ;)
>> >>>>
>> >>>> I have some problems because now I'm finishing my test implementation
>> >>> but
>> >>>> it
>> >>>> seems that I can't execute queries on the InMemory Repository, it
>> >>> returns a
>> >>>> null string in the convertStatusCode method.
>> >>>>
>> >>>> The CMIS Repository Connector that I implemented for ManifoldCF has a
>> >>> job
>> >>>> parameter that is the CMIS Query, this parameter is used by agents to
>> >>>> select
>> >>>> all the contents that needs to be indexed on the Output Connector
>> (for
>> >>>> example Apache Solr).
>> >>>> Without a query feature exposed by the InMemory Repository I can't
>> test
>> >>> the
>> >>>> connector in the right way.
>> >>>>
>> >>>> I tried to use the latest version of the InMemory Repository
>> >>>> (0.5.0-SNAPSHOT) but with the same result.
>> >>>>
>> >>>> Have you got any ideas to solve this problem?
>> >>>> Thank you for your support.
>> >>>>
>> >>>> Regards,
>> >>>> Piergiorgio
>> >>>>
>> >>>>
>> >>>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>> >>>>
>> >>>>> Hi Chemistries,
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> is anyone of us already involved in the Lucene project?
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> Reading this here
>> >>>>> http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> I think it would make sense to give them an introduction to what we
>> >>> have.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> if I understand this correctly one of the options they discuss is to
>> >>>> create
>> >>>>> an InMemory mock server. It does not make much sense to duplicate
>> what
>> >>> we
>> >>>>> already have (and if we need getContentChanges() for that I am happy
>> >>> to
>> >>>>> implement this).
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> Jens
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Piergiorgio Lucidi
>> >>>> Web: http://about.me/piergiorgiolucidi
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Piergiorgio Lucidi
>> >>> Web: http://about.me/piergiorgiolucidi
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Piergiorgio Lucidi
>> >> Web: http://about.me/piergiorgiolucidi
>> >>
>> >>
>> >
>> >
>>
>>
>
>
> --
> Piergiorgio Lucidi
> Web: http://about.me/piergiorgiolucidi
>
>


-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi

Re: CMIS and Lucene

Posted by Piergiorgio Lucidi <pi...@gmail.com>.
Hi Florian,

thank you for your suggestion but trying to deploy the InMemory Repository
webapp on Tomcat works fine.
It seems that there is a problem only on Jetty, maybe later I will try to
add other dependencies and I'll let you know.

Now I'm trying with the 0.5.0-SNAPSHOT but without any result.

2011/8/3 Florian Müller <fl...@alfresco.com>

> Hi,
>
> Make sure that you have all OpenCMIS dependencies in your classpath.
>
>
> Florian
>
> On 03/08/2011 15:44, Piergiorgio Lucidi wrote:
> > Building the latest version of the code in the trunk, the InMemory
> > Repository can't deploy anymore, it returns this exception trying
> deploying
> > on Jetty:
> >
> >  GRAVE: WSSERVLET11: failed to parse runtime descriptor:
> >> com.sun.xml.ws.util.ServiceConfigurationError:
> >> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
> >>
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
> >> is specified in
> >>
> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
> >> could not be instantiated: java.lang.ClassCastException
> >> com.sun.xml.ws.util.ServiceConfigurationError:
> >> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
> >>
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
> >> is specified in
> >>
> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
> >> could not be instantiated: java.lang.ClassCastException
> >> at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:233)
> >> at com.sun.xml.ws.util.ServiceFinder.access$300(ServiceFinder.java:141)
> >> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
> >> ServiceFinder.java:379)
> >> at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory.create(
> >> TubelineAssemblerFactory.java:104)
> >> at com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:147)
> >> at com.sun.xml.ws.server.EndpointFactory.createEndpoint(
> >> EndpointFactory.java:218)
> >> at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
> >> at
> com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(
> >> DeploymentDescriptorParser.java:253)
> >> at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(
> >> DeploymentDescriptorParser.java:147)
> >> at
> >>
> com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(
> >> WSServletContextListener.java:108)
> >> at org.mortbay.jetty.handler.ContextHandler.startContext(
> >> ContextHandler.java:549)
> >> at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
> >> at org.mortbay.jetty.webapp.WebAppContext.startContext(
> >> WebAppContext.java:1282)
> >> at org.mortbay.jetty.handler.ContextHandler.doStart(
> >> ContextHandler.java:518)
> >> at
> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
> >> at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
> >> )
> >> at org.mortbay.jetty.handler.HandlerCollection.doStart(
> >> HandlerCollection.java:152)
> >> at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
> >> )
> >> at org.mortbay.jetty.handler.HandlerWrapper.doStart(
> >> HandlerWrapper.java:130)
> >> at org.mortbay.jetty.Server.doStart(Server.java:224)
> >> at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
> >> )
> >> at org.apache.manifoldcf.cmis_tests.Base.setUp(Base.java:333)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke(
> >> NativeMethodAccessorImpl.java:39)
> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> >> DelegatingMethodAccessorImpl.java:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597)
> >> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> >> FrameworkMethod.java:44)
> >> at org.junit.internal.runners.model.ReflectiveCallable.run(
> >> ReflectiveCallable.java:15)
> >> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> >> FrameworkMethod.java:41)
> >> at org.junit.internal.runners.statements.RunBefores.evaluate(
> >> RunBefores.java:27)
> >> at org.junit.internal.runners.statements.RunAfters.evaluate(
> >> RunAfters.java:31)
> >> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
> >> BlockJUnit4ClassRunner.java:79)
> >> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> >> BlockJUnit4ClassRunner.java:71)
> >> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> >> BlockJUnit4ClassRunner.java:49)
> >> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> >> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> >> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> >> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> >> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> >> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> >> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> >> JUnit4TestReference.java:49)
> >> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> >> TestExecution.java:38)
> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> >> RemoteTestRunner.java:467)
> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> >> RemoteTestRunner.java:683)
> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> >> RemoteTestRunner.java:390)
> >> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> >> RemoteTestRunner.java:197)
> >> Caused by: java.lang.ClassCastException
> >> at java.lang.Class.cast(Class.java:2990)
> >> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
> >> ServiceFinder.java:374)
> >> ... 43 more
> >
> >
> >
> > 2011/8/3 Piergiorgio Lucidi <pi...@gmail.com>
> >
> >> I'm building OpenCMIS to investigate me too :-P
> >>
> >>
> >> 2011/8/3 Jens Hübel <jh...@opentext.com>
> >>
> >>> Thanks for posting! I will try to rebuild and take a look why it does
> not
> >>> work. To get further information I need the server logs, but with your
> code
> >>> I can debug it.
> >>>
> >>> Jens
> >>>
> >>> -----Original Message-----
> >>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
> >>> Sent: Mittwoch, 3. August 2011 14:48
> >>> To: dev@chemistry.apache.org
> >>> Subject: Re: CMIS and Lucene
> >>>
> >>> Hi Jens,
> >>>
> >>> here the code of my integration test that is used to create some
> content
> >>> in
> >>> the InMemory Repository, the OpenCMIS server is running because it is
> >>> bootstrapped by Jetty / Maven. The CMIS Repository Connector works fine
> >>> with
> >>> Alfresco 3.4d Community, but I would like to have the OpenCMIS server
> in
> >>> the
> >>> test suite.
> >>>
> >>> In the following snippet I started to initialize the test environment
> with
> >>> a
> >>> new folder with a new content, here I don't have any problem, it works
> >>> with
> >>> the InMemory Repository:
> >>>
> >>>  private Session getCmisClientSession(){
> >>>>     // default factory implementation
> >>>>     SessionFactory factory = SessionFactoryImpl.newInstance();
> >>>>     Map<String, String> parameters = new HashMap<String, String>();
> >>>>     // user credentials
> >>>>     parameters.put(SessionParameter.USER, "dummyuser");
> >>>>     parameters.put(SessionParameter.PASSWORD, "dummysecret");
> >>>>     // connection settings
> >>>>     parameters.put(SessionParameter.ATOMPUB_URL,
> >>> CMIS_ENDPOINT_TEST_SERVER
> >>>> );
> >>>>     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
> >>>> .value());
> >>>>     // create session
> >>>>     return factory.getRepositories(parameters).get(0).createSession();
> >>>>   }
> >>>>  @Before
> >>>>   public void createTestArea()
> >>>>     throws Exception
> >>>>   {
> >>>>     try
> >>>>     {
> >>>>       Session session = getCmisClientSession();
> >>>>       //creating a new folder
> >>>>       Folder root = session.getRootFolder();
> >>>>       Map<String, Object> folderProperties = new HashMap<String,
> >>>> Object>();
> >>>>       folderProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
> >>>>       folderProperties.put(PropertyIds.NAME, "testdata");
> >>>>
> >>>>       Folder newFolder = root.createFolder(folderProperties);
> >>>>       //create a new content in the folder
> >>>>       String name = "testdata1.txt";
> >>>>       // properties
> >>>>       // (minimal set: name and object type id)
> >>>>       Map<String, Object> contentProperties = new HashMap<String,
> >>>> Object>();
> >>>>       contentProperties.put(PropertyIds.OBJECT_TYPE_ID,
> >>> "cmis:document");
> >>>>       contentProperties.put(PropertyIds.NAME, name);
> >>>>
> >>>>       // content
> >>>>       byte[] content = "CMIS Testdata One".getBytes();
> >>>>       InputStream stream = new ByteArrayInputStream(content);
> >>>>       ContentStream contentStream = new ContentStreamImpl(name,
> >>> newBigInteger(content),
> >>>> "text/plain", stream);
> >>>>
> >>>>        // create a major version
> >>>>       Document newContent1 =
> newFolder.createDocument(contentProperties,
> >>>> contentStream, null);
> >>>
> >>>
> >>> But if I try to search the new content in the InMemory Repository, in
> the
> >>> same way I implemented in the CMIS Repository Connector:
> >>>
> >>>  ItemIterable<QueryResult> results = session.query("SELECT * FROM
> >>>> cmis:folder WHERE cmis:name='testdata'", false);
> >>>>       for (QueryResult result : results) {
> >>>>         String id =
> result.getPropertyValueById(PropertyIds.OBJECT_ID);
> >>>>       }
> >>>
> >>>
> >>>
> >>> It returns the following exception:
> >>>
> >>>  org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
> >>> null
> >>>> at
> >>>>
> >>>
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
> >>>> AbstractAtomPubService.java:450)
> >>>> at
> >>>>
> >>>
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
> >>>> AbstractAtomPubService.java:568)
> >>>> at
> >>>>
> >>>
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
> >>>> DiscoveryServiceImpl.java:141)
> >>>> at
> org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
> >>>> SessionImpl.java:557)
> >>>> at
> >>>>
> >>>
> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
> >>>> AbstractIterator.java:132)
> >>>> at
> >>>>
> >>>
> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
> >>>> CollectionIterator.java:48)
> >>>> at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
> >>>> APISanityTest.java:139)
> >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>>> at sun.reflect.NativeMethodAccessorImpl.invoke(
> >>>> NativeMethodAccessorImpl.java:39)
> >>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> >>>> DelegatingMethodAccessorImpl.java:25)
> >>>> at java.lang.reflect.Method.invoke(Method.java:597)
> >>>> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> >>>> FrameworkMethod.java:44)
> >>>> at org.junit.internal.runners.model.ReflectiveCallable.run(
> >>>> ReflectiveCallable.java:15)
> >>>> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> >>>> FrameworkMethod.java:41)
> >>>> at org.junit.internal.runners.statements.RunBefores.evaluate(
> >>>> RunBefores.java:27)
> >>>> at org.junit.internal.runners.statements.RunAfters.evaluate(
> >>>> RunAfters.java:31)
> >>>> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
> >>>> BlockJUnit4ClassRunner.java:79)
> >>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> >>>> BlockJUnit4ClassRunner.java:71)
> >>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> >>>> BlockJUnit4ClassRunner.java:49)
> >>>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> >>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> >>>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> >>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> >>>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> >>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> >>>> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> >>>> JUnit4TestReference.java:49)
> >>>> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> >>>> TestExecution.java:38)
> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> >>>> RemoteTestRunner.java:467)
> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> >>>> RemoteTestRunner.java:683)
> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> >>>> RemoteTestRunner.java:390)
> >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> >>>> RemoteTestRunner.java:197)
> >>>
> >>>
> >>> Let me know if you have any hints!
> >>>
> >>> Thank you again for your support.
> >>>
> >>> Regards,
> >>>
> >>> Piergiorgio
> >>>
> >>> 2011/8/3 Jens Hübel <jh...@opentext.com>
> >>>
> >>>> Hi Pergiorio,
> >>>>
> >>>> do you have a code piece that I can take a look at? What is your
> client
> >>>> API? Do you connect to Chemistry client API
> >>> (chemistry-opencmis-client-api)?
> >>>> Or perhaps you can grab the query sent from the log file?
> >>>>
> >>>> Thanks Jens
> >>>>
> >>>>
> >>>> -----Original Message-----
> >>>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
> >>>> Sent: Mittwoch, 3. August 2011 13:22
> >>>> To: dev@chemistry.apache.org
> >>>> Subject: Re: CMIS and Lucene
> >>>>
> >>>> Hi Jens,
> >>>>
> >>>> I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
> >>>> project implementing the CMIS Connector using OpenCMIS 0.4.0.
> >>>>
> >>>> Now I'm working on integration test trying to use the OpenCMIS
> InMemory
> >>>> Repository that is available from Apache Chemistry ;)
> >>>>
> >>>> I have some problems because now I'm finishing my test implementation
> >>> but
> >>>> it
> >>>> seems that I can't execute queries on the InMemory Repository, it
> >>> returns a
> >>>> null string in the convertStatusCode method.
> >>>>
> >>>> The CMIS Repository Connector that I implemented for ManifoldCF has a
> >>> job
> >>>> parameter that is the CMIS Query, this parameter is used by agents to
> >>>> select
> >>>> all the contents that needs to be indexed on the Output Connector (for
> >>>> example Apache Solr).
> >>>> Without a query feature exposed by the InMemory Repository I can't
> test
> >>> the
> >>>> connector in the right way.
> >>>>
> >>>> I tried to use the latest version of the InMemory Repository
> >>>> (0.5.0-SNAPSHOT) but with the same result.
> >>>>
> >>>> Have you got any ideas to solve this problem?
> >>>> Thank you for your support.
> >>>>
> >>>> Regards,
> >>>> Piergiorgio
> >>>>
> >>>>
> >>>> 2011/8/3 Jens Hübel <jh...@opentext.com>
> >>>>
> >>>>> Hi Chemistries,
> >>>>>
> >>>>>
> >>>>>
> >>>>> is anyone of us already involved in the Lucene project?
> >>>>>
> >>>>>
> >>>>>
> >>>>> Reading this here
> >>>>> http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
> >>>>>
> >>>>>
> >>>>>
> >>>>> I think it would make sense to give them an introduction to what we
> >>> have.
> >>>>>
> >>>>>
> >>>>>
> >>>>> if I understand this correctly one of the options they discuss is to
> >>>> create
> >>>>> an InMemory mock server. It does not make much sense to duplicate
> what
> >>> we
> >>>>> already have (and if we need getContentChanges() for that I am happy
> >>> to
> >>>>> implement this).
> >>>>>
> >>>>>
> >>>>>
> >>>>> Jens
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>> --
> >>>> Piergiorgio Lucidi
> >>>> Web: http://about.me/piergiorgiolucidi
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Piergiorgio Lucidi
> >>> Web: http://about.me/piergiorgiolucidi
> >>>
> >>
> >>
> >>
> >> --
> >> Piergiorgio Lucidi
> >> Web: http://about.me/piergiorgiolucidi
> >>
> >>
> >
> >
>
>


-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi

Re: CMIS and Lucene

Posted by Florian Müller <fl...@alfresco.com>.
Hi,

Make sure that you have all OpenCMIS dependencies in your classpath.


Florian

On 03/08/2011 15:44, Piergiorgio Lucidi wrote:
> Building the latest version of the code in the trunk, the InMemory
> Repository can't deploy anymore, it returns this exception trying deploying
> on Jetty:
> 
>  GRAVE: WSSERVLET11: failed to parse runtime descriptor:
>> com.sun.xml.ws.util.ServiceConfigurationError:
>> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
>> is specified in
>> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
>> could not be instantiated: java.lang.ClassCastException
>> com.sun.xml.ws.util.ServiceConfigurationError:
>> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
>> is specified in
>> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
>> could not be instantiated: java.lang.ClassCastException
>> at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:233)
>> at com.sun.xml.ws.util.ServiceFinder.access$300(ServiceFinder.java:141)
>> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
>> ServiceFinder.java:379)
>> at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory.create(
>> TubelineAssemblerFactory.java:104)
>> at com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:147)
>> at com.sun.xml.ws.server.EndpointFactory.createEndpoint(
>> EndpointFactory.java:218)
>> at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
>> at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(
>> DeploymentDescriptorParser.java:253)
>> at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(
>> DeploymentDescriptorParser.java:147)
>> at
>> com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(
>> WSServletContextListener.java:108)
>> at org.mortbay.jetty.handler.ContextHandler.startContext(
>> ContextHandler.java:549)
>> at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
>> at org.mortbay.jetty.webapp.WebAppContext.startContext(
>> WebAppContext.java:1282)
>> at org.mortbay.jetty.handler.ContextHandler.doStart(
>> ContextHandler.java:518)
>> at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
>> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>> )
>> at org.mortbay.jetty.handler.HandlerCollection.doStart(
>> HandlerCollection.java:152)
>> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>> )
>> at org.mortbay.jetty.handler.HandlerWrapper.doStart(
>> HandlerWrapper.java:130)
>> at org.mortbay.jetty.Server.doStart(Server.java:224)
>> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
>> )
>> at org.apache.manifoldcf.cmis_tests.Base.setUp(Base.java:333)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(
>> NativeMethodAccessorImpl.java:39)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>> FrameworkMethod.java:44)
>> at org.junit.internal.runners.model.ReflectiveCallable.run(
>> ReflectiveCallable.java:15)
>> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>> FrameworkMethod.java:41)
>> at org.junit.internal.runners.statements.RunBefores.evaluate(
>> RunBefores.java:27)
>> at org.junit.internal.runners.statements.RunAfters.evaluate(
>> RunAfters.java:31)
>> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>> BlockJUnit4ClassRunner.java:79)
>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>> BlockJUnit4ClassRunner.java:71)
>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>> BlockJUnit4ClassRunner.java:49)
>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>> JUnit4TestReference.java:49)
>> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>> TestExecution.java:38)
>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>> RemoteTestRunner.java:467)
>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>> RemoteTestRunner.java:683)
>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>> RemoteTestRunner.java:390)
>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>> RemoteTestRunner.java:197)
>> Caused by: java.lang.ClassCastException
>> at java.lang.Class.cast(Class.java:2990)
>> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
>> ServiceFinder.java:374)
>> ... 43 more
> 
> 
> 
> 2011/8/3 Piergiorgio Lucidi <pi...@gmail.com>
> 
>> I'm building OpenCMIS to investigate me too :-P
>>
>>
>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>
>>> Thanks for posting! I will try to rebuild and take a look why it does not
>>> work. To get further information I need the server logs, but with your code
>>> I can debug it.
>>>
>>> Jens
>>>
>>> -----Original Message-----
>>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>>> Sent: Mittwoch, 3. August 2011 14:48
>>> To: dev@chemistry.apache.org
>>> Subject: Re: CMIS and Lucene
>>>
>>> Hi Jens,
>>>
>>> here the code of my integration test that is used to create some content
>>> in
>>> the InMemory Repository, the OpenCMIS server is running because it is
>>> bootstrapped by Jetty / Maven. The CMIS Repository Connector works fine
>>> with
>>> Alfresco 3.4d Community, but I would like to have the OpenCMIS server in
>>> the
>>> test suite.
>>>
>>> In the following snippet I started to initialize the test environment with
>>> a
>>> new folder with a new content, here I don't have any problem, it works
>>> with
>>> the InMemory Repository:
>>>
>>>  private Session getCmisClientSession(){
>>>>     // default factory implementation
>>>>     SessionFactory factory = SessionFactoryImpl.newInstance();
>>>>     Map<String, String> parameters = new HashMap<String, String>();
>>>>     // user credentials
>>>>     parameters.put(SessionParameter.USER, "dummyuser");
>>>>     parameters.put(SessionParameter.PASSWORD, "dummysecret");
>>>>     // connection settings
>>>>     parameters.put(SessionParameter.ATOMPUB_URL,
>>> CMIS_ENDPOINT_TEST_SERVER
>>>> );
>>>>     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
>>>> .value());
>>>>     // create session
>>>>     return factory.getRepositories(parameters).get(0).createSession();
>>>>   }
>>>>  @Before
>>>>   public void createTestArea()
>>>>     throws Exception
>>>>   {
>>>>     try
>>>>     {
>>>>       Session session = getCmisClientSession();
>>>>       //creating a new folder
>>>>       Folder root = session.getRootFolder();
>>>>       Map<String, Object> folderProperties = new HashMap<String,
>>>> Object>();
>>>>       folderProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
>>>>       folderProperties.put(PropertyIds.NAME, "testdata");
>>>>
>>>>       Folder newFolder = root.createFolder(folderProperties);
>>>>       //create a new content in the folder
>>>>       String name = "testdata1.txt";
>>>>       // properties
>>>>       // (minimal set: name and object type id)
>>>>       Map<String, Object> contentProperties = new HashMap<String,
>>>> Object>();
>>>>       contentProperties.put(PropertyIds.OBJECT_TYPE_ID,
>>> "cmis:document");
>>>>       contentProperties.put(PropertyIds.NAME, name);
>>>>
>>>>       // content
>>>>       byte[] content = "CMIS Testdata One".getBytes();
>>>>       InputStream stream = new ByteArrayInputStream(content);
>>>>       ContentStream contentStream = new ContentStreamImpl(name,
>>> newBigInteger(content),
>>>> "text/plain", stream);
>>>>
>>>>        // create a major version
>>>>       Document newContent1 = newFolder.createDocument(contentProperties,
>>>> contentStream, null);
>>>
>>>
>>> But if I try to search the new content in the InMemory Repository, in the
>>> same way I implemented in the CMIS Repository Connector:
>>>
>>>  ItemIterable<QueryResult> results = session.query("SELECT * FROM
>>>> cmis:folder WHERE cmis:name='testdata'", false);
>>>>       for (QueryResult result : results) {
>>>>         String id = result.getPropertyValueById(PropertyIds.OBJECT_ID);
>>>>       }
>>>
>>>
>>>
>>> It returns the following exception:
>>>
>>>  org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
>>> null
>>>> at
>>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
>>>> AbstractAtomPubService.java:450)
>>>> at
>>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
>>>> AbstractAtomPubService.java:568)
>>>> at
>>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
>>>> DiscoveryServiceImpl.java:141)
>>>> at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
>>>> SessionImpl.java:557)
>>>> at
>>>>
>>> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
>>>> AbstractIterator.java:132)
>>>> at
>>>>
>>> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
>>>> CollectionIterator.java:48)
>>>> at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
>>>> APISanityTest.java:139)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(
>>>> NativeMethodAccessorImpl.java:39)
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>>>> DelegatingMethodAccessorImpl.java:25)
>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>>>> FrameworkMethod.java:44)
>>>> at org.junit.internal.runners.model.ReflectiveCallable.run(
>>>> ReflectiveCallable.java:15)
>>>> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>>>> FrameworkMethod.java:41)
>>>> at org.junit.internal.runners.statements.RunBefores.evaluate(
>>>> RunBefores.java:27)
>>>> at org.junit.internal.runners.statements.RunAfters.evaluate(
>>>> RunAfters.java:31)
>>>> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>>>> BlockJUnit4ClassRunner.java:79)
>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>>>> BlockJUnit4ClassRunner.java:71)
>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>>>> BlockJUnit4ClassRunner.java:49)
>>>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>>> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>>>> JUnit4TestReference.java:49)
>>>> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>>>> TestExecution.java:38)
>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>>>> RemoteTestRunner.java:467)
>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>>>> RemoteTestRunner.java:683)
>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>>>> RemoteTestRunner.java:390)
>>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>>>> RemoteTestRunner.java:197)
>>>
>>>
>>> Let me know if you have any hints!
>>>
>>> Thank you again for your support.
>>>
>>> Regards,
>>>
>>> Piergiorgio
>>>
>>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>>
>>>> Hi Pergiorio,
>>>>
>>>> do you have a code piece that I can take a look at? What is your client
>>>> API? Do you connect to Chemistry client API
>>> (chemistry-opencmis-client-api)?
>>>> Or perhaps you can grab the query sent from the log file?
>>>>
>>>> Thanks Jens
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>>>> Sent: Mittwoch, 3. August 2011 13:22
>>>> To: dev@chemistry.apache.org
>>>> Subject: Re: CMIS and Lucene
>>>>
>>>> Hi Jens,
>>>>
>>>> I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
>>>> project implementing the CMIS Connector using OpenCMIS 0.4.0.
>>>>
>>>> Now I'm working on integration test trying to use the OpenCMIS InMemory
>>>> Repository that is available from Apache Chemistry ;)
>>>>
>>>> I have some problems because now I'm finishing my test implementation
>>> but
>>>> it
>>>> seems that I can't execute queries on the InMemory Repository, it
>>> returns a
>>>> null string in the convertStatusCode method.
>>>>
>>>> The CMIS Repository Connector that I implemented for ManifoldCF has a
>>> job
>>>> parameter that is the CMIS Query, this parameter is used by agents to
>>>> select
>>>> all the contents that needs to be indexed on the Output Connector (for
>>>> example Apache Solr).
>>>> Without a query feature exposed by the InMemory Repository I can't test
>>> the
>>>> connector in the right way.
>>>>
>>>> I tried to use the latest version of the InMemory Repository
>>>> (0.5.0-SNAPSHOT) but with the same result.
>>>>
>>>> Have you got any ideas to solve this problem?
>>>> Thank you for your support.
>>>>
>>>> Regards,
>>>> Piergiorgio
>>>>
>>>>
>>>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>>>
>>>>> Hi Chemistries,
>>>>>
>>>>>
>>>>>
>>>>> is anyone of us already involved in the Lucene project?
>>>>>
>>>>>
>>>>>
>>>>> Reading this here
>>>>> http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
>>>>>
>>>>>
>>>>>
>>>>> I think it would make sense to give them an introduction to what we
>>> have.
>>>>>
>>>>>
>>>>>
>>>>> if I understand this correctly one of the options they discuss is to
>>>> create
>>>>> an InMemory mock server. It does not make much sense to duplicate what
>>> we
>>>>> already have (and if we need getContentChanges() for that I am happy
>>> to
>>>>> implement this).
>>>>>
>>>>>
>>>>>
>>>>> Jens
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Piergiorgio Lucidi
>>>> Web: http://about.me/piergiorgiolucidi
>>>>
>>>
>>>
>>>
>>> --
>>> Piergiorgio Lucidi
>>> Web: http://about.me/piergiorgiolucidi
>>>
>>
>>
>>
>> --
>> Piergiorgio Lucidi
>> Web: http://about.me/piergiorgiolucidi
>>
>>
> 
> 


Re: CMIS and Lucene

Posted by Piergiorgio Lucidi <pi...@gmail.com>.
Building the latest version of the code in the trunk, the InMemory
Repository can't deploy anymore, it returns this exception trying deploying
on Jetty:

 GRAVE: WSSERVLET11: failed to parse runtime descriptor:
> com.sun.xml.ws.util.ServiceConfigurationError:
> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
> is specified in
> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
> could not be instantiated: java.lang.ClassCastException
> com.sun.xml.ws.util.ServiceConfigurationError:
> com.sun.xml.ws.api.pipe.TubelineAssemblerFactory: Provider
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.wss.WssTubelineAssemblerFactory
> is specified in
> file:/Users/piergiorgiolucidi/Documents/workspaces/manifold/opencmis/chemistry-opencmis-client/chemistry-opencmis-client-bindings/target/classes/META-INF/services/com.sun.xml.ws.api.pipe.TubelineAssemblerFactorybut
> could not be instantiated: java.lang.ClassCastException
> at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:233)
> at com.sun.xml.ws.util.ServiceFinder.access$300(ServiceFinder.java:141)
> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
> ServiceFinder.java:379)
> at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory.create(
> TubelineAssemblerFactory.java:104)
> at com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:147)
> at com.sun.xml.ws.server.EndpointFactory.createEndpoint(
> EndpointFactory.java:218)
> at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
> at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(
> DeploymentDescriptorParser.java:253)
> at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(
> DeploymentDescriptorParser.java:147)
> at
> com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(
> WSServletContextListener.java:108)
> at org.mortbay.jetty.handler.ContextHandler.startContext(
> ContextHandler.java:549)
> at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
> at org.mortbay.jetty.webapp.WebAppContext.startContext(
> WebAppContext.java:1282)
> at org.mortbay.jetty.handler.ContextHandler.doStart(
> ContextHandler.java:518)
> at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
> )
> at org.mortbay.jetty.handler.HandlerCollection.doStart(
> HandlerCollection.java:152)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
> )
> at org.mortbay.jetty.handler.HandlerWrapper.doStart(
> HandlerWrapper.java:130)
> at org.mortbay.jetty.Server.doStart(Server.java:224)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50
> )
> at org.apache.manifoldcf.cmis_tests.Base.setUp(Base.java:333)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> FrameworkMethod.java:44)
> at org.junit.internal.runners.model.ReflectiveCallable.run(
> ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> FrameworkMethod.java:41)
> at org.junit.internal.runners.statements.RunBefores.evaluate(
> RunBefores.java:27)
> at org.junit.internal.runners.statements.RunAfters.evaluate(
> RunAfters.java:31)
> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
> BlockJUnit4ClassRunner.java:79)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:71)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> JUnit4TestReference.java:49)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:197)
> Caused by: java.lang.ClassCastException
> at java.lang.Class.cast(Class.java:2990)
> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(
> ServiceFinder.java:374)
> ... 43 more



2011/8/3 Piergiorgio Lucidi <pi...@gmail.com>

> I'm building OpenCMIS to investigate me too :-P
>
>
> 2011/8/3 Jens Hübel <jh...@opentext.com>
>
>> Thanks for posting! I will try to rebuild and take a look why it does not
>> work. To get further information I need the server logs, but with your code
>> I can debug it.
>>
>> Jens
>>
>> -----Original Message-----
>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>> Sent: Mittwoch, 3. August 2011 14:48
>> To: dev@chemistry.apache.org
>> Subject: Re: CMIS and Lucene
>>
>> Hi Jens,
>>
>> here the code of my integration test that is used to create some content
>> in
>> the InMemory Repository, the OpenCMIS server is running because it is
>> bootstrapped by Jetty / Maven. The CMIS Repository Connector works fine
>> with
>> Alfresco 3.4d Community, but I would like to have the OpenCMIS server in
>> the
>> test suite.
>>
>> In the following snippet I started to initialize the test environment with
>> a
>> new folder with a new content, here I don't have any problem, it works
>> with
>> the InMemory Repository:
>>
>>  private Session getCmisClientSession(){
>> >     // default factory implementation
>> >     SessionFactory factory = SessionFactoryImpl.newInstance();
>> >     Map<String, String> parameters = new HashMap<String, String>();
>> >     // user credentials
>> >     parameters.put(SessionParameter.USER, "dummyuser");
>> >     parameters.put(SessionParameter.PASSWORD, "dummysecret");
>> >     // connection settings
>> >     parameters.put(SessionParameter.ATOMPUB_URL,
>> CMIS_ENDPOINT_TEST_SERVER
>> > );
>> >     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
>> > .value());
>> >     // create session
>> >     return factory.getRepositories(parameters).get(0).createSession();
>> >   }
>> >  @Before
>> >   public void createTestArea()
>> >     throws Exception
>> >   {
>> >     try
>> >     {
>> >       Session session = getCmisClientSession();
>> >       //creating a new folder
>> >       Folder root = session.getRootFolder();
>> >       Map<String, Object> folderProperties = new HashMap<String,
>> > Object>();
>> >       folderProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
>> >       folderProperties.put(PropertyIds.NAME, "testdata");
>> >
>> >       Folder newFolder = root.createFolder(folderProperties);
>> >       //create a new content in the folder
>> >       String name = "testdata1.txt";
>> >       // properties
>> >       // (minimal set: name and object type id)
>> >       Map<String, Object> contentProperties = new HashMap<String,
>> > Object>();
>> >       contentProperties.put(PropertyIds.OBJECT_TYPE_ID,
>> "cmis:document");
>> >       contentProperties.put(PropertyIds.NAME, name);
>> >
>> >       // content
>> >       byte[] content = "CMIS Testdata One".getBytes();
>> >       InputStream stream = new ByteArrayInputStream(content);
>> >       ContentStream contentStream = new ContentStreamImpl(name,
>> newBigInteger(content),
>> > "text/plain", stream);
>> >
>> >        // create a major version
>> >       Document newContent1 = newFolder.createDocument(contentProperties,
>> > contentStream, null);
>>
>>
>> But if I try to search the new content in the InMemory Repository, in the
>> same way I implemented in the CMIS Repository Connector:
>>
>>  ItemIterable<QueryResult> results = session.query("SELECT * FROM
>> > cmis:folder WHERE cmis:name='testdata'", false);
>> >       for (QueryResult result : results) {
>> >         String id = result.getPropertyValueById(PropertyIds.OBJECT_ID);
>> >       }
>>
>>
>>
>> It returns the following exception:
>>
>>  org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
>> null
>> > at
>> >
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
>> > AbstractAtomPubService.java:450)
>> > at
>> >
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
>> > AbstractAtomPubService.java:568)
>> > at
>> >
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
>> > DiscoveryServiceImpl.java:141)
>> > at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
>> > SessionImpl.java:557)
>> > at
>> >
>> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
>> > AbstractIterator.java:132)
>> > at
>> >
>> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
>> > CollectionIterator.java:48)
>> > at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
>> > APISanityTest.java:139)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke(
>> > NativeMethodAccessorImpl.java:39)
>> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> > DelegatingMethodAccessorImpl.java:25)
>> > at java.lang.reflect.Method.invoke(Method.java:597)
>> > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>> > FrameworkMethod.java:44)
>> > at org.junit.internal.runners.model.ReflectiveCallable.run(
>> > ReflectiveCallable.java:15)
>> > at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>> > FrameworkMethod.java:41)
>> > at org.junit.internal.runners.statements.RunBefores.evaluate(
>> > RunBefores.java:27)
>> > at org.junit.internal.runners.statements.RunAfters.evaluate(
>> > RunAfters.java:31)
>> > at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>> > BlockJUnit4ClassRunner.java:79)
>> > at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>> > BlockJUnit4ClassRunner.java:71)
>> > at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>> > BlockJUnit4ClassRunner.java:49)
>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> > at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>> > JUnit4TestReference.java:49)
>> > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>> > TestExecution.java:38)
>> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>> > RemoteTestRunner.java:467)
>> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>> > RemoteTestRunner.java:683)
>> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>> > RemoteTestRunner.java:390)
>> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>> > RemoteTestRunner.java:197)
>>
>>
>> Let me know if you have any hints!
>>
>> Thank you again for your support.
>>
>> Regards,
>>
>> Piergiorgio
>>
>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>
>> > Hi Pergiorio,
>> >
>> > do you have a code piece that I can take a look at? What is your client
>> > API? Do you connect to Chemistry client API
>> (chemistry-opencmis-client-api)?
>> > Or perhaps you can grab the query sent from the log file?
>> >
>> > Thanks Jens
>> >
>> >
>> > -----Original Message-----
>> > From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>> > Sent: Mittwoch, 3. August 2011 13:22
>> > To: dev@chemistry.apache.org
>> > Subject: Re: CMIS and Lucene
>> >
>> > Hi Jens,
>> >
>> > I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
>> > project implementing the CMIS Connector using OpenCMIS 0.4.0.
>> >
>> > Now I'm working on integration test trying to use the OpenCMIS InMemory
>> > Repository that is available from Apache Chemistry ;)
>> >
>> > I have some problems because now I'm finishing my test implementation
>> but
>> > it
>> > seems that I can't execute queries on the InMemory Repository, it
>> returns a
>> > null string in the convertStatusCode method.
>> >
>> > The CMIS Repository Connector that I implemented for ManifoldCF has a
>> job
>> > parameter that is the CMIS Query, this parameter is used by agents to
>> > select
>> > all the contents that needs to be indexed on the Output Connector (for
>> > example Apache Solr).
>> > Without a query feature exposed by the InMemory Repository I can't test
>> the
>> > connector in the right way.
>> >
>> > I tried to use the latest version of the InMemory Repository
>> > (0.5.0-SNAPSHOT) but with the same result.
>> >
>> > Have you got any ideas to solve this problem?
>> > Thank you for your support.
>> >
>> > Regards,
>> > Piergiorgio
>> >
>> >
>> > 2011/8/3 Jens Hübel <jh...@opentext.com>
>> >
>> > > Hi Chemistries,
>> > >
>> > >
>> > >
>> > > is anyone of us already involved in the Lucene project?
>> > >
>> > >
>> > >
>> > > Reading this here
>> > > http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
>> > >
>> > >
>> > >
>> > > I think it would make sense to give them an introduction to what we
>> have.
>> > >
>> > >
>> > >
>> > > if I understand this correctly one of the options they discuss is to
>> > create
>> > > an InMemory mock server. It does not make much sense to duplicate what
>> we
>> > > already have (and if we need getContentChanges() for that I am happy
>> to
>> > > implement this).
>> > >
>> > >
>> > >
>> > > Jens
>> > >
>> > >
>> > >
>> > >
>> >
>> >
>> > --
>> > Piergiorgio Lucidi
>> > Web: http://about.me/piergiorgiolucidi
>> >
>>
>>
>>
>> --
>> Piergiorgio Lucidi
>> Web: http://about.me/piergiorgiolucidi
>>
>
>
>
> --
> Piergiorgio Lucidi
> Web: http://about.me/piergiorgiolucidi
>
>


-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi

Re: CMIS and Lucene

Posted by Piergiorgio Lucidi <pi...@gmail.com>.
I'm building OpenCMIS to investigate me too :-P

2011/8/3 Jens Hübel <jh...@opentext.com>

> Thanks for posting! I will try to rebuild and take a look why it does not
> work. To get further information I need the server logs, but with your code
> I can debug it.
>
> Jens
>
> -----Original Message-----
> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
> Sent: Mittwoch, 3. August 2011 14:48
> To: dev@chemistry.apache.org
> Subject: Re: CMIS and Lucene
>
> Hi Jens,
>
> here the code of my integration test that is used to create some content in
> the InMemory Repository, the OpenCMIS server is running because it is
> bootstrapped by Jetty / Maven. The CMIS Repository Connector works fine
> with
> Alfresco 3.4d Community, but I would like to have the OpenCMIS server in
> the
> test suite.
>
> In the following snippet I started to initialize the test environment with
> a
> new folder with a new content, here I don't have any problem, it works with
> the InMemory Repository:
>
>  private Session getCmisClientSession(){
> >     // default factory implementation
> >     SessionFactory factory = SessionFactoryImpl.newInstance();
> >     Map<String, String> parameters = new HashMap<String, String>();
> >     // user credentials
> >     parameters.put(SessionParameter.USER, "dummyuser");
> >     parameters.put(SessionParameter.PASSWORD, "dummysecret");
> >     // connection settings
> >     parameters.put(SessionParameter.ATOMPUB_URL,
> CMIS_ENDPOINT_TEST_SERVER
> > );
> >     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
> > .value());
> >     // create session
> >     return factory.getRepositories(parameters).get(0).createSession();
> >   }
> >  @Before
> >   public void createTestArea()
> >     throws Exception
> >   {
> >     try
> >     {
> >       Session session = getCmisClientSession();
> >       //creating a new folder
> >       Folder root = session.getRootFolder();
> >       Map<String, Object> folderProperties = new HashMap<String,
> > Object>();
> >       folderProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
> >       folderProperties.put(PropertyIds.NAME, "testdata");
> >
> >       Folder newFolder = root.createFolder(folderProperties);
> >       //create a new content in the folder
> >       String name = "testdata1.txt";
> >       // properties
> >       // (minimal set: name and object type id)
> >       Map<String, Object> contentProperties = new HashMap<String,
> > Object>();
> >       contentProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
> >       contentProperties.put(PropertyIds.NAME, name);
> >
> >       // content
> >       byte[] content = "CMIS Testdata One".getBytes();
> >       InputStream stream = new ByteArrayInputStream(content);
> >       ContentStream contentStream = new ContentStreamImpl(name,
> newBigInteger(content),
> > "text/plain", stream);
> >
> >        // create a major version
> >       Document newContent1 = newFolder.createDocument(contentProperties,
> > contentStream, null);
>
>
> But if I try to search the new content in the InMemory Repository, in the
> same way I implemented in the CMIS Repository Connector:
>
>  ItemIterable<QueryResult> results = session.query("SELECT * FROM
> > cmis:folder WHERE cmis:name='testdata'", false);
> >       for (QueryResult result : results) {
> >         String id = result.getPropertyValueById(PropertyIds.OBJECT_ID);
> >       }
>
>
>
> It returns the following exception:
>
>  org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
> null
> > at
> >
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
> > AbstractAtomPubService.java:450)
> > at
> >
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
> > AbstractAtomPubService.java:568)
> > at
> >
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
> > DiscoveryServiceImpl.java:141)
> > at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
> > SessionImpl.java:557)
> > at
> >
> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
> > AbstractIterator.java:132)
> > at
> >
> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
> > CollectionIterator.java:48)
> > at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
> > APISanityTest.java:139)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke(
> > NativeMethodAccessorImpl.java:39)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > DelegatingMethodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> > FrameworkMethod.java:44)
> > at org.junit.internal.runners.model.ReflectiveCallable.run(
> > ReflectiveCallable.java:15)
> > at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> > FrameworkMethod.java:41)
> > at org.junit.internal.runners.statements.RunBefores.evaluate(
> > RunBefores.java:27)
> > at org.junit.internal.runners.statements.RunAfters.evaluate(
> > RunAfters.java:31)
> > at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
> > BlockJUnit4ClassRunner.java:79)
> > at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> > BlockJUnit4ClassRunner.java:71)
> > at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> > BlockJUnit4ClassRunner.java:49)
> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> > at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> > JUnit4TestReference.java:49)
> > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> > TestExecution.java:38)
> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > RemoteTestRunner.java:467)
> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > RemoteTestRunner.java:683)
> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> > RemoteTestRunner.java:390)
> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> > RemoteTestRunner.java:197)
>
>
> Let me know if you have any hints!
>
> Thank you again for your support.
>
> Regards,
>
> Piergiorgio
>
> 2011/8/3 Jens Hübel <jh...@opentext.com>
>
> > Hi Pergiorio,
> >
> > do you have a code piece that I can take a look at? What is your client
> > API? Do you connect to Chemistry client API
> (chemistry-opencmis-client-api)?
> > Or perhaps you can grab the query sent from the log file?
> >
> > Thanks Jens
> >
> >
> > -----Original Message-----
> > From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
> > Sent: Mittwoch, 3. August 2011 13:22
> > To: dev@chemistry.apache.org
> > Subject: Re: CMIS and Lucene
> >
> > Hi Jens,
> >
> > I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
> > project implementing the CMIS Connector using OpenCMIS 0.4.0.
> >
> > Now I'm working on integration test trying to use the OpenCMIS InMemory
> > Repository that is available from Apache Chemistry ;)
> >
> > I have some problems because now I'm finishing my test implementation but
> > it
> > seems that I can't execute queries on the InMemory Repository, it returns
> a
> > null string in the convertStatusCode method.
> >
> > The CMIS Repository Connector that I implemented for ManifoldCF has a job
> > parameter that is the CMIS Query, this parameter is used by agents to
> > select
> > all the contents that needs to be indexed on the Output Connector (for
> > example Apache Solr).
> > Without a query feature exposed by the InMemory Repository I can't test
> the
> > connector in the right way.
> >
> > I tried to use the latest version of the InMemory Repository
> > (0.5.0-SNAPSHOT) but with the same result.
> >
> > Have you got any ideas to solve this problem?
> > Thank you for your support.
> >
> > Regards,
> > Piergiorgio
> >
> >
> > 2011/8/3 Jens Hübel <jh...@opentext.com>
> >
> > > Hi Chemistries,
> > >
> > >
> > >
> > > is anyone of us already involved in the Lucene project?
> > >
> > >
> > >
> > > Reading this here
> > > http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
> > >
> > >
> > >
> > > I think it would make sense to give them an introduction to what we
> have.
> > >
> > >
> > >
> > > if I understand this correctly one of the options they discuss is to
> > create
> > > an InMemory mock server. It does not make much sense to duplicate what
> we
> > > already have (and if we need getContentChanges() for that I am happy to
> > > implement this).
> > >
> > >
> > >
> > > Jens
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Piergiorgio Lucidi
> > Web: http://about.me/piergiorgiolucidi
> >
>
>
>
> --
> Piergiorgio Lucidi
> Web: http://about.me/piergiorgiolucidi
>



-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi

RE: CMIS and Lucene

Posted by Jens Hübel <jh...@opentext.com>.
Thanks for posting! I will try to rebuild and take a look why it does not work. To get further information I need the server logs, but with your code I can debug it.

Jens

-----Original Message-----
From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com] 
Sent: Mittwoch, 3. August 2011 14:48
To: dev@chemistry.apache.org
Subject: Re: CMIS and Lucene

Hi Jens,

here the code of my integration test that is used to create some content in
the InMemory Repository, the OpenCMIS server is running because it is
bootstrapped by Jetty / Maven. The CMIS Repository Connector works fine with
Alfresco 3.4d Community, but I would like to have the OpenCMIS server in the
test suite.

In the following snippet I started to initialize the test environment with a
new folder with a new content, here I don't have any problem, it works with
the InMemory Repository:

 private Session getCmisClientSession(){
>     // default factory implementation
>     SessionFactory factory = SessionFactoryImpl.newInstance();
>     Map<String, String> parameters = new HashMap<String, String>();
>     // user credentials
>     parameters.put(SessionParameter.USER, "dummyuser");
>     parameters.put(SessionParameter.PASSWORD, "dummysecret");
>     // connection settings
>     parameters.put(SessionParameter.ATOMPUB_URL, CMIS_ENDPOINT_TEST_SERVER
> );
>     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
> .value());
>     // create session
>     return factory.getRepositories(parameters).get(0).createSession();
>   }
>  @Before
>   public void createTestArea()
>     throws Exception
>   {
>     try
>     {
>       Session session = getCmisClientSession();
>       //creating a new folder
>       Folder root = session.getRootFolder();
>       Map<String, Object> folderProperties = new HashMap<String,
> Object>();
>       folderProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
>       folderProperties.put(PropertyIds.NAME, "testdata");
>
>       Folder newFolder = root.createFolder(folderProperties);
>       //create a new content in the folder
>       String name = "testdata1.txt";
>       // properties
>       // (minimal set: name and object type id)
>       Map<String, Object> contentProperties = new HashMap<String,
> Object>();
>       contentProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
>       contentProperties.put(PropertyIds.NAME, name);
>
>       // content
>       byte[] content = "CMIS Testdata One".getBytes();
>       InputStream stream = new ByteArrayInputStream(content);
>       ContentStream contentStream = new ContentStreamImpl(name, newBigInteger(content),
> "text/plain", stream);
>
>        // create a major version
>       Document newContent1 = newFolder.createDocument(contentProperties,
> contentStream, null);


But if I try to search the new content in the InMemory Repository, in the
same way I implemented in the CMIS Repository Connector:

 ItemIterable<QueryResult> results = session.query("SELECT * FROM
> cmis:folder WHERE cmis:name='testdata'", false);
>       for (QueryResult result : results) {
>         String id = result.getPropertyValueById(PropertyIds.OBJECT_ID);
>       }



It returns the following exception:

 org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: null
> at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
> AbstractAtomPubService.java:450)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
> AbstractAtomPubService.java:568)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
> DiscoveryServiceImpl.java:141)
> at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
> SessionImpl.java:557)
> at
> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
> AbstractIterator.java:132)
> at
> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
> CollectionIterator.java:48)
> at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
> APISanityTest.java:139)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> FrameworkMethod.java:44)
> at org.junit.internal.runners.model.ReflectiveCallable.run(
> ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> FrameworkMethod.java:41)
> at org.junit.internal.runners.statements.RunBefores.evaluate(
> RunBefores.java:27)
> at org.junit.internal.runners.statements.RunAfters.evaluate(
> RunAfters.java:31)
> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
> BlockJUnit4ClassRunner.java:79)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:71)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> JUnit4TestReference.java:49)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:197)


Let me know if you have any hints!

Thank you again for your support.

Regards,

Piergiorgio

2011/8/3 Jens Hübel <jh...@opentext.com>

> Hi Pergiorio,
>
> do you have a code piece that I can take a look at? What is your client
> API? Do you connect to Chemistry client API (chemistry-opencmis-client-api)?
> Or perhaps you can grab the query sent from the log file?
>
> Thanks Jens
>
>
> -----Original Message-----
> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
> Sent: Mittwoch, 3. August 2011 13:22
> To: dev@chemistry.apache.org
> Subject: Re: CMIS and Lucene
>
> Hi Jens,
>
> I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
> project implementing the CMIS Connector using OpenCMIS 0.4.0.
>
> Now I'm working on integration test trying to use the OpenCMIS InMemory
> Repository that is available from Apache Chemistry ;)
>
> I have some problems because now I'm finishing my test implementation but
> it
> seems that I can't execute queries on the InMemory Repository, it returns a
> null string in the convertStatusCode method.
>
> The CMIS Repository Connector that I implemented for ManifoldCF has a job
> parameter that is the CMIS Query, this parameter is used by agents to
> select
> all the contents that needs to be indexed on the Output Connector (for
> example Apache Solr).
> Without a query feature exposed by the InMemory Repository I can't test the
> connector in the right way.
>
> I tried to use the latest version of the InMemory Repository
> (0.5.0-SNAPSHOT) but with the same result.
>
> Have you got any ideas to solve this problem?
> Thank you for your support.
>
> Regards,
> Piergiorgio
>
>
> 2011/8/3 Jens Hübel <jh...@opentext.com>
>
> > Hi Chemistries,
> >
> >
> >
> > is anyone of us already involved in the Lucene project?
> >
> >
> >
> > Reading this here
> > http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
> >
> >
> >
> > I think it would make sense to give them an introduction to what we have.
> >
> >
> >
> > if I understand this correctly one of the options they discuss is to
> create
> > an InMemory mock server. It does not make much sense to duplicate what we
> > already have (and if we need getContentChanges() for that I am happy to
> > implement this).
> >
> >
> >
> > Jens
> >
> >
> >
> >
>
>
> --
> Piergiorgio Lucidi
> Web: http://about.me/piergiorgiolucidi
>



-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi

Re: CMIS and Lucene

Posted by Piergiorgio Lucidi <pi...@gmail.com>.
I finished the integration test implementation using the latest OpenCMIS
InMemory Repository and it works fine in Apache ManifoldCF.

When does this new fix for the InMemory Repository will be available as
artifact in the public Maven repository?

Thank you.
Piergiorgio

2011/8/4 Piergiorgio Lucidi <pi...@gmail.com>

> Hi Jens,
>
> 2011/8/4 Jens Hübel <jh...@opentext.com>
>
>> Hi Piergiorgio,
>>
>> you are right. I could reproduce the problem. There is a bug in the query
>> implementation of the InMemory server if you query for predefined properties
>> like cmis:name, cmis:createdBy, etc. :-(
>>
>> I have fixed this, so hopefully this works for you now if you take the
>> latest build. I have created CMIS-413 for this (
>> https://issues.apache.org/jira/browse/CMIS-414). Please reopen if you
>> still have issues.
>>
>
> Great! Thank you very much for fixing this issue, I'll let you know soon if
> it works for my integration test for ManifoldCF :)
>
>
>>
>> One more note: Your test code is quite fragile if you use a fixed name for
>> your test document/folder. This implementation does not allow multiple
>> objects with the same name in one folder. This means unless you restart the
>> server your code will work only once. I recommend you using a random UUID as
>> name or something like that. In the default configuration the InMemory
>> creates a tree of document and folders by default. So it might not be
>> necessary to create objects at all (use the Workbench to take a look at
>> that). If you really need this reproducible behavior there is an option to
>> run the server using the local binding in the same Java VM. Then you can
>> restart the server with each test. The InMemory JUnit tests use this
>> mechanism. I do not recommend this however, because you bypass the whole
>> protocol layer for AtomPub/SOAP. This leaves many issues undetected a client
>> may see in a real connection later (and of course you lose the option to
>> switch to another CMIS server just by changing configuration).
>>
>> Jens
>>
>
> Thanks for your suggestion!
>
> Now I would like to use the AtomPub protocol deployed using Maven, but I
> found a problem to configure Jetty with the latest version of the InMemory
> webapp, because there aren't anymore two dependencies: jsr250 and jsr181.
>
> Florian suggested a solution based on taking a look at the OpenCMIS code,
> I'll let you know about this :-P
>
> Now I'm finishing to implement the integration test code using the public
> Alfresco CMIS server and then I can start to integrate the latest version of
> the OpenCMIS InMemory server.
>
> Thank you all guys for your support.
>
> Piergiorgio
>
>
>>
>>
>> -----Original Message-----
>> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>> Sent: Mittwoch, 3. August 2011 14:48
>> To: dev@chemistry.apache.org
>> Subject: Re: CMIS and Lucene
>>
>> Hi Jens,
>>
>> here the code of my integration test that is used to create some content
>> in
>> the InMemory Repository, the OpenCMIS server is running because it is
>> bootstrapped by Jetty / Maven. The CMIS Repository Connector works fine
>> with
>> Alfresco 3.4d Community, but I would like to have the OpenCMIS server in
>> the
>> test suite.
>>
>> In the following snippet I started to initialize the test environment with
>> a
>> new folder with a new content, here I don't have any problem, it works
>> with
>> the InMemory Repository:
>>
>>  private Session getCmisClientSession(){
>> >     // default factory implementation
>> >     SessionFactory factory = SessionFactoryImpl.newInstance();
>> >     Map<String, String> parameters = new HashMap<String, String>();
>> >     // user credentials
>> >     parameters.put(SessionParameter.USER, "dummyuser");
>> >     parameters.put(SessionParameter.PASSWORD, "dummysecret");
>> >     // connection settings
>> >     parameters.put(SessionParameter.ATOMPUB_URL,
>> CMIS_ENDPOINT_TEST_SERVER
>> > );
>> >     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
>> > .value());
>> >     // create session
>> >     return factory.getRepositories(parameters).get(0).createSession();
>> >   }
>> >  @Before
>> >   public void createTestArea()
>> >     throws Exception
>> >   {
>> >     try
>> >     {
>> >       Session session = getCmisClientSession();
>> >       //creating a new folder
>> >       Folder root = session.getRootFolder();
>> >       Map<String, Object> folderProperties = new HashMap<String,
>> > Object>();
>> >       folderProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
>> >       folderProperties.put(PropertyIds.NAME, "testdata");
>> >
>> >       Folder newFolder = root.createFolder(folderProperties);
>> >       //create a new content in the folder
>> >       String name = "testdata1.txt";
>> >       // properties
>> >       // (minimal set: name and object type id)
>> >       Map<String, Object> contentProperties = new HashMap<String,
>> > Object>();
>> >       contentProperties.put(PropertyIds.OBJECT_TYPE_ID,
>> "cmis:document");
>> >       contentProperties.put(PropertyIds.NAME, name);
>> >
>> >       // content
>> >       byte[] content = "CMIS Testdata One".getBytes();
>> >       InputStream stream = new ByteArrayInputStream(content);
>> >       ContentStream contentStream = new ContentStreamImpl(name,
>> newBigInteger(content),
>> > "text/plain", stream);
>> >
>> >        // create a major version
>> >       Document newContent1 = newFolder.createDocument(contentProperties,
>> > contentStream, null);
>>
>>
>> But if I try to search the new content in the InMemory Repository, in the
>> same way I implemented in the CMIS Repository Connector:
>>
>>  ItemIterable<QueryResult> results = session.query("SELECT * FROM
>> > cmis:folder WHERE cmis:name='testdata'", false);
>> >       for (QueryResult result : results) {
>> >         String id = result.getPropertyValueById(PropertyIds.OBJECT_ID);
>> >       }
>>
>>
>>
>> It returns the following exception:
>>
>>  org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
>> null
>> > at
>> >
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
>> > AbstractAtomPubService.java:450)
>> > at
>> >
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
>> > AbstractAtomPubService.java:568)
>> > at
>> >
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
>> > DiscoveryServiceImpl.java:141)
>> > at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
>> > SessionImpl.java:557)
>> > at
>> >
>> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
>> > AbstractIterator.java:132)
>> > at
>> >
>> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
>> > CollectionIterator.java:48)
>> > at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
>> > APISanityTest.java:139)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke(
>> > NativeMethodAccessorImpl.java:39)
>> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> > DelegatingMethodAccessorImpl.java:25)
>> > at java.lang.reflect.Method.invoke(Method.java:597)
>> > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>> > FrameworkMethod.java:44)
>> > at org.junit.internal.runners.model.ReflectiveCallable.run(
>> > ReflectiveCallable.java:15)
>> > at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>> > FrameworkMethod.java:41)
>> > at org.junit.internal.runners.statements.RunBefores.evaluate(
>> > RunBefores.java:27)
>> > at org.junit.internal.runners.statements.RunAfters.evaluate(
>> > RunAfters.java:31)
>> > at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>> > BlockJUnit4ClassRunner.java:79)
>> > at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>> > BlockJUnit4ClassRunner.java:71)
>> > at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>> > BlockJUnit4ClassRunner.java:49)
>> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> > at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>> > JUnit4TestReference.java:49)
>> > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>> > TestExecution.java:38)
>> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>> > RemoteTestRunner.java:467)
>> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>> > RemoteTestRunner.java:683)
>> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>> > RemoteTestRunner.java:390)
>> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>> > RemoteTestRunner.java:197)
>>
>>
>> Let me know if you have any hints!
>>
>> Thank you again for your support.
>>
>> Regards,
>>
>> Piergiorgio
>>
>> 2011/8/3 Jens Hübel <jh...@opentext.com>
>>
>> > Hi Pergiorio,
>> >
>> > do you have a code piece that I can take a look at? What is your client
>> > API? Do you connect to Chemistry client API
>> (chemistry-opencmis-client-api)?
>> > Or perhaps you can grab the query sent from the log file?
>> >
>> > Thanks Jens
>> >
>> >
>> > -----Original Message-----
>> > From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
>> > Sent: Mittwoch, 3. August 2011 13:22
>> > To: dev@chemistry.apache.org
>> > Subject: Re: CMIS and Lucene
>> >
>> > Hi Jens,
>> >
>> > I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
>> > project implementing the CMIS Connector using OpenCMIS 0.4.0.
>> >
>> > Now I'm working on integration test trying to use the OpenCMIS InMemory
>> > Repository that is available from Apache Chemistry ;)
>> >
>> > I have some problems because now I'm finishing my test implementation
>> but
>> > it
>> > seems that I can't execute queries on the InMemory Repository, it
>> returns a
>> > null string in the convertStatusCode method.
>> >
>> > The CMIS Repository Connector that I implemented for ManifoldCF has a
>> job
>> > parameter that is the CMIS Query, this parameter is used by agents to
>> > select
>> > all the contents that needs to be indexed on the Output Connector (for
>> > example Apache Solr).
>> > Without a query feature exposed by the InMemory Repository I can't test
>> the
>> > connector in the right way.
>> >
>> > I tried to use the latest version of the InMemory Repository
>> > (0.5.0-SNAPSHOT) but with the same result.
>> >
>> > Have you got any ideas to solve this problem?
>> > Thank you for your support.
>> >
>> > Regards,
>> > Piergiorgio
>> >
>> >
>> > 2011/8/3 Jens Hübel <jh...@opentext.com>
>> >
>> > > Hi Chemistries,
>> > >
>> > >
>> > >
>> > > is anyone of us already involved in the Lucene project?
>> > >
>> > >
>> > >
>> > > Reading this here
>> > > http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
>> > >
>> > >
>> > >
>> > > I think it would make sense to give them an introduction to what we
>> have.
>> > >
>> > >
>> > >
>> > > if I understand this correctly one of the options they discuss is to
>> > create
>> > > an InMemory mock server. It does not make much sense to duplicate what
>> we
>> > > already have (and if we need getContentChanges() for that I am happy
>> to
>> > > implement this).
>> > >
>> > >
>> > >
>> > > Jens
>> > >
>> > >
>> > >
>> > >
>> >
>> >
>> > --
>> > Piergiorgio Lucidi
>> > Web: http://about.me/piergiorgiolucidi
>> >
>>
>>
>>
>> --
>> Piergiorgio Lucidi
>> Web: http://about.me/piergiorgiolucidi
>>
>
>
>
> --
> Piergiorgio Lucidi
> Web: http://about.me/piergiorgiolucidi
>
>

Re: CMIS and Lucene

Posted by Piergiorgio Lucidi <pi...@gmail.com>.
Hi Jens,

2011/8/4 Jens Hübel <jh...@opentext.com>

> Hi Piergiorgio,
>
> you are right. I could reproduce the problem. There is a bug in the query
> implementation of the InMemory server if you query for predefined properties
> like cmis:name, cmis:createdBy, etc. :-(
>
> I have fixed this, so hopefully this works for you now if you take the
> latest build. I have created CMIS-413 for this (
> https://issues.apache.org/jira/browse/CMIS-414). Please reopen if you
> still have issues.
>

Great! Thank you very much for fixing this issue, I'll let you know soon if
it works for my integration test for ManifoldCF :)


>
> One more note: Your test code is quite fragile if you use a fixed name for
> your test document/folder. This implementation does not allow multiple
> objects with the same name in one folder. This means unless you restart the
> server your code will work only once. I recommend you using a random UUID as
> name or something like that. In the default configuration the InMemory
> creates a tree of document and folders by default. So it might not be
> necessary to create objects at all (use the Workbench to take a look at
> that). If you really need this reproducible behavior there is an option to
> run the server using the local binding in the same Java VM. Then you can
> restart the server with each test. The InMemory JUnit tests use this
> mechanism. I do not recommend this however, because you bypass the whole
> protocol layer for AtomPub/SOAP. This leaves many issues undetected a client
> may see in a real connection later (and of course you lose the option to
> switch to another CMIS server just by changing configuration).
>
> Jens
>

Thanks for your suggestion!

Now I would like to use the AtomPub protocol deployed using Maven, but I
found a problem to configure Jetty with the latest version of the InMemory
webapp, because there aren't anymore two dependencies: jsr250 and jsr181.

Florian suggested a solution based on taking a look at the OpenCMIS code,
I'll let you know about this :-P

Now I'm finishing to implement the integration test code using the public
Alfresco CMIS server and then I can start to integrate the latest version of
the OpenCMIS InMemory server.

Thank you all guys for your support.

Piergiorgio


>
>
> -----Original Message-----
> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
> Sent: Mittwoch, 3. August 2011 14:48
> To: dev@chemistry.apache.org
> Subject: Re: CMIS and Lucene
>
> Hi Jens,
>
> here the code of my integration test that is used to create some content in
> the InMemory Repository, the OpenCMIS server is running because it is
> bootstrapped by Jetty / Maven. The CMIS Repository Connector works fine
> with
> Alfresco 3.4d Community, but I would like to have the OpenCMIS server in
> the
> test suite.
>
> In the following snippet I started to initialize the test environment with
> a
> new folder with a new content, here I don't have any problem, it works with
> the InMemory Repository:
>
>  private Session getCmisClientSession(){
> >     // default factory implementation
> >     SessionFactory factory = SessionFactoryImpl.newInstance();
> >     Map<String, String> parameters = new HashMap<String, String>();
> >     // user credentials
> >     parameters.put(SessionParameter.USER, "dummyuser");
> >     parameters.put(SessionParameter.PASSWORD, "dummysecret");
> >     // connection settings
> >     parameters.put(SessionParameter.ATOMPUB_URL,
> CMIS_ENDPOINT_TEST_SERVER
> > );
> >     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
> > .value());
> >     // create session
> >     return factory.getRepositories(parameters).get(0).createSession();
> >   }
> >  @Before
> >   public void createTestArea()
> >     throws Exception
> >   {
> >     try
> >     {
> >       Session session = getCmisClientSession();
> >       //creating a new folder
> >       Folder root = session.getRootFolder();
> >       Map<String, Object> folderProperties = new HashMap<String,
> > Object>();
> >       folderProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
> >       folderProperties.put(PropertyIds.NAME, "testdata");
> >
> >       Folder newFolder = root.createFolder(folderProperties);
> >       //create a new content in the folder
> >       String name = "testdata1.txt";
> >       // properties
> >       // (minimal set: name and object type id)
> >       Map<String, Object> contentProperties = new HashMap<String,
> > Object>();
> >       contentProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
> >       contentProperties.put(PropertyIds.NAME, name);
> >
> >       // content
> >       byte[] content = "CMIS Testdata One".getBytes();
> >       InputStream stream = new ByteArrayInputStream(content);
> >       ContentStream contentStream = new ContentStreamImpl(name,
> newBigInteger(content),
> > "text/plain", stream);
> >
> >        // create a major version
> >       Document newContent1 = newFolder.createDocument(contentProperties,
> > contentStream, null);
>
>
> But if I try to search the new content in the InMemory Repository, in the
> same way I implemented in the CMIS Repository Connector:
>
>  ItemIterable<QueryResult> results = session.query("SELECT * FROM
> > cmis:folder WHERE cmis:name='testdata'", false);
> >       for (QueryResult result : results) {
> >         String id = result.getPropertyValueById(PropertyIds.OBJECT_ID);
> >       }
>
>
>
> It returns the following exception:
>
>  org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
> null
> > at
> >
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
> > AbstractAtomPubService.java:450)
> > at
> >
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
> > AbstractAtomPubService.java:568)
> > at
> >
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
> > DiscoveryServiceImpl.java:141)
> > at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
> > SessionImpl.java:557)
> > at
> >
> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
> > AbstractIterator.java:132)
> > at
> >
> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
> > CollectionIterator.java:48)
> > at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
> > APISanityTest.java:139)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke(
> > NativeMethodAccessorImpl.java:39)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > DelegatingMethodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> > FrameworkMethod.java:44)
> > at org.junit.internal.runners.model.ReflectiveCallable.run(
> > ReflectiveCallable.java:15)
> > at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> > FrameworkMethod.java:41)
> > at org.junit.internal.runners.statements.RunBefores.evaluate(
> > RunBefores.java:27)
> > at org.junit.internal.runners.statements.RunAfters.evaluate(
> > RunAfters.java:31)
> > at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
> > BlockJUnit4ClassRunner.java:79)
> > at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> > BlockJUnit4ClassRunner.java:71)
> > at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> > BlockJUnit4ClassRunner.java:49)
> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> > at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> > JUnit4TestReference.java:49)
> > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> > TestExecution.java:38)
> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > RemoteTestRunner.java:467)
> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > RemoteTestRunner.java:683)
> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> > RemoteTestRunner.java:390)
> > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> > RemoteTestRunner.java:197)
>
>
> Let me know if you have any hints!
>
> Thank you again for your support.
>
> Regards,
>
> Piergiorgio
>
> 2011/8/3 Jens Hübel <jh...@opentext.com>
>
> > Hi Pergiorio,
> >
> > do you have a code piece that I can take a look at? What is your client
> > API? Do you connect to Chemistry client API
> (chemistry-opencmis-client-api)?
> > Or perhaps you can grab the query sent from the log file?
> >
> > Thanks Jens
> >
> >
> > -----Original Message-----
> > From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
> > Sent: Mittwoch, 3. August 2011 13:22
> > To: dev@chemistry.apache.org
> > Subject: Re: CMIS and Lucene
> >
> > Hi Jens,
> >
> > I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
> > project implementing the CMIS Connector using OpenCMIS 0.4.0.
> >
> > Now I'm working on integration test trying to use the OpenCMIS InMemory
> > Repository that is available from Apache Chemistry ;)
> >
> > I have some problems because now I'm finishing my test implementation but
> > it
> > seems that I can't execute queries on the InMemory Repository, it returns
> a
> > null string in the convertStatusCode method.
> >
> > The CMIS Repository Connector that I implemented for ManifoldCF has a job
> > parameter that is the CMIS Query, this parameter is used by agents to
> > select
> > all the contents that needs to be indexed on the Output Connector (for
> > example Apache Solr).
> > Without a query feature exposed by the InMemory Repository I can't test
> the
> > connector in the right way.
> >
> > I tried to use the latest version of the InMemory Repository
> > (0.5.0-SNAPSHOT) but with the same result.
> >
> > Have you got any ideas to solve this problem?
> > Thank you for your support.
> >
> > Regards,
> > Piergiorgio
> >
> >
> > 2011/8/3 Jens Hübel <jh...@opentext.com>
> >
> > > Hi Chemistries,
> > >
> > >
> > >
> > > is anyone of us already involved in the Lucene project?
> > >
> > >
> > >
> > > Reading this here
> > > http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
> > >
> > >
> > >
> > > I think it would make sense to give them an introduction to what we
> have.
> > >
> > >
> > >
> > > if I understand this correctly one of the options they discuss is to
> > create
> > > an InMemory mock server. It does not make much sense to duplicate what
> we
> > > already have (and if we need getContentChanges() for that I am happy to
> > > implement this).
> > >
> > >
> > >
> > > Jens
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Piergiorgio Lucidi
> > Web: http://about.me/piergiorgiolucidi
> >
>
>
>
> --
> Piergiorgio Lucidi
> Web: http://about.me/piergiorgiolucidi
>



-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi

RE: CMIS and Lucene

Posted by Jens Hübel <jh...@opentext.com>.
Hi Piergiorgio,

you are right. I could reproduce the problem. There is a bug in the query implementation of the InMemory server if you query for predefined properties like cmis:name, cmis:createdBy, etc. :-(

I have fixed this, so hopefully this works for you now if you take the latest build. I have created CMIS-413 for this (https://issues.apache.org/jira/browse/CMIS-414). Please reopen if you still have issues.

One more note: Your test code is quite fragile if you use a fixed name for your test document/folder. This implementation does not allow multiple objects with the same name in one folder. This means unless you restart the server your code will work only once. I recommend you using a random UUID as name or something like that. In the default configuration the InMemory creates a tree of document and folders by default. So it might not be necessary to create objects at all (use the Workbench to take a look at that). If you really need this reproducible behavior there is an option to run the server using the local binding in the same Java VM. Then you can restart the server with each test. The InMemory JUnit tests use this mechanism. I do not recommend this however, because you bypass the whole protocol layer for AtomPub/SOAP. This leaves many issues undetected a client may see in a real connection later (and of course you lose the option to switch to another CMIS server just by changing configuration).

Jens


-----Original Message-----
From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com] 
Sent: Mittwoch, 3. August 2011 14:48
To: dev@chemistry.apache.org
Subject: Re: CMIS and Lucene

Hi Jens,

here the code of my integration test that is used to create some content in
the InMemory Repository, the OpenCMIS server is running because it is
bootstrapped by Jetty / Maven. The CMIS Repository Connector works fine with
Alfresco 3.4d Community, but I would like to have the OpenCMIS server in the
test suite.

In the following snippet I started to initialize the test environment with a
new folder with a new content, here I don't have any problem, it works with
the InMemory Repository:

 private Session getCmisClientSession(){
>     // default factory implementation
>     SessionFactory factory = SessionFactoryImpl.newInstance();
>     Map<String, String> parameters = new HashMap<String, String>();
>     // user credentials
>     parameters.put(SessionParameter.USER, "dummyuser");
>     parameters.put(SessionParameter.PASSWORD, "dummysecret");
>     // connection settings
>     parameters.put(SessionParameter.ATOMPUB_URL, CMIS_ENDPOINT_TEST_SERVER
> );
>     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
> .value());
>     // create session
>     return factory.getRepositories(parameters).get(0).createSession();
>   }
>  @Before
>   public void createTestArea()
>     throws Exception
>   {
>     try
>     {
>       Session session = getCmisClientSession();
>       //creating a new folder
>       Folder root = session.getRootFolder();
>       Map<String, Object> folderProperties = new HashMap<String,
> Object>();
>       folderProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
>       folderProperties.put(PropertyIds.NAME, "testdata");
>
>       Folder newFolder = root.createFolder(folderProperties);
>       //create a new content in the folder
>       String name = "testdata1.txt";
>       // properties
>       // (minimal set: name and object type id)
>       Map<String, Object> contentProperties = new HashMap<String,
> Object>();
>       contentProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
>       contentProperties.put(PropertyIds.NAME, name);
>
>       // content
>       byte[] content = "CMIS Testdata One".getBytes();
>       InputStream stream = new ByteArrayInputStream(content);
>       ContentStream contentStream = new ContentStreamImpl(name, newBigInteger(content),
> "text/plain", stream);
>
>        // create a major version
>       Document newContent1 = newFolder.createDocument(contentProperties,
> contentStream, null);


But if I try to search the new content in the InMemory Repository, in the
same way I implemented in the CMIS Repository Connector:

 ItemIterable<QueryResult> results = session.query("SELECT * FROM
> cmis:folder WHERE cmis:name='testdata'", false);
>       for (QueryResult result : results) {
>         String id = result.getPropertyValueById(PropertyIds.OBJECT_ID);
>       }



It returns the following exception:

 org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: null
> at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
> AbstractAtomPubService.java:450)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
> AbstractAtomPubService.java:568)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
> DiscoveryServiceImpl.java:141)
> at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
> SessionImpl.java:557)
> at
> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
> AbstractIterator.java:132)
> at
> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
> CollectionIterator.java:48)
> at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
> APISanityTest.java:139)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> FrameworkMethod.java:44)
> at org.junit.internal.runners.model.ReflectiveCallable.run(
> ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> FrameworkMethod.java:41)
> at org.junit.internal.runners.statements.RunBefores.evaluate(
> RunBefores.java:27)
> at org.junit.internal.runners.statements.RunAfters.evaluate(
> RunAfters.java:31)
> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
> BlockJUnit4ClassRunner.java:79)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:71)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> JUnit4TestReference.java:49)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:197)


Let me know if you have any hints!

Thank you again for your support.

Regards,

Piergiorgio

2011/8/3 Jens Hübel <jh...@opentext.com>

> Hi Pergiorio,
>
> do you have a code piece that I can take a look at? What is your client
> API? Do you connect to Chemistry client API (chemistry-opencmis-client-api)?
> Or perhaps you can grab the query sent from the log file?
>
> Thanks Jens
>
>
> -----Original Message-----
> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
> Sent: Mittwoch, 3. August 2011 13:22
> To: dev@chemistry.apache.org
> Subject: Re: CMIS and Lucene
>
> Hi Jens,
>
> I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
> project implementing the CMIS Connector using OpenCMIS 0.4.0.
>
> Now I'm working on integration test trying to use the OpenCMIS InMemory
> Repository that is available from Apache Chemistry ;)
>
> I have some problems because now I'm finishing my test implementation but
> it
> seems that I can't execute queries on the InMemory Repository, it returns a
> null string in the convertStatusCode method.
>
> The CMIS Repository Connector that I implemented for ManifoldCF has a job
> parameter that is the CMIS Query, this parameter is used by agents to
> select
> all the contents that needs to be indexed on the Output Connector (for
> example Apache Solr).
> Without a query feature exposed by the InMemory Repository I can't test the
> connector in the right way.
>
> I tried to use the latest version of the InMemory Repository
> (0.5.0-SNAPSHOT) but with the same result.
>
> Have you got any ideas to solve this problem?
> Thank you for your support.
>
> Regards,
> Piergiorgio
>
>
> 2011/8/3 Jens Hübel <jh...@opentext.com>
>
> > Hi Chemistries,
> >
> >
> >
> > is anyone of us already involved in the Lucene project?
> >
> >
> >
> > Reading this here
> > http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
> >
> >
> >
> > I think it would make sense to give them an introduction to what we have.
> >
> >
> >
> > if I understand this correctly one of the options they discuss is to
> create
> > an InMemory mock server. It does not make much sense to duplicate what we
> > already have (and if we need getContentChanges() for that I am happy to
> > implement this).
> >
> >
> >
> > Jens
> >
> >
> >
> >
>
>
> --
> Piergiorgio Lucidi
> Web: http://about.me/piergiorgiolucidi
>



-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi

Re: CMIS and Lucene

Posted by Piergiorgio Lucidi <pi...@gmail.com>.
Hi Jens,

here the code of my integration test that is used to create some content in
the InMemory Repository, the OpenCMIS server is running because it is
bootstrapped by Jetty / Maven. The CMIS Repository Connector works fine with
Alfresco 3.4d Community, but I would like to have the OpenCMIS server in the
test suite.

In the following snippet I started to initialize the test environment with a
new folder with a new content, here I don't have any problem, it works with
the InMemory Repository:

 private Session getCmisClientSession(){
>     // default factory implementation
>     SessionFactory factory = SessionFactoryImpl.newInstance();
>     Map<String, String> parameters = new HashMap<String, String>();
>     // user credentials
>     parameters.put(SessionParameter.USER, "dummyuser");
>     parameters.put(SessionParameter.PASSWORD, "dummysecret");
>     // connection settings
>     parameters.put(SessionParameter.ATOMPUB_URL, CMIS_ENDPOINT_TEST_SERVER
> );
>     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB
> .value());
>     // create session
>     return factory.getRepositories(parameters).get(0).createSession();
>   }
>  @Before
>   public void createTestArea()
>     throws Exception
>   {
>     try
>     {
>       Session session = getCmisClientSession();
>       //creating a new folder
>       Folder root = session.getRootFolder();
>       Map<String, Object> folderProperties = new HashMap<String,
> Object>();
>       folderProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
>       folderProperties.put(PropertyIds.NAME, "testdata");
>
>       Folder newFolder = root.createFolder(folderProperties);
>       //create a new content in the folder
>       String name = "testdata1.txt";
>       // properties
>       // (minimal set: name and object type id)
>       Map<String, Object> contentProperties = new HashMap<String,
> Object>();
>       contentProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
>       contentProperties.put(PropertyIds.NAME, name);
>
>       // content
>       byte[] content = "CMIS Testdata One".getBytes();
>       InputStream stream = new ByteArrayInputStream(content);
>       ContentStream contentStream = new ContentStreamImpl(name, newBigInteger(content),
> "text/plain", stream);
>
>        // create a major version
>       Document newContent1 = newFolder.createDocument(contentProperties,
> contentStream, null);


But if I try to search the new content in the InMemory Repository, in the
same way I implemented in the CMIS Repository Connector:

 ItemIterable<QueryResult> results = session.query("SELECT * FROM
> cmis:folder WHERE cmis:name='testdata'", false);
>       for (QueryResult result : results) {
>         String id = result.getPropertyValueById(PropertyIds.OBJECT_ID);
>       }



It returns the following exception:

 org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: null
> at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
> AbstractAtomPubService.java:450)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(
> AbstractAtomPubService.java:568)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
> DiscoveryServiceImpl.java:141)
> at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
> SessionImpl.java:557)
> at
> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
> AbstractIterator.java:132)
> at
> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(
> CollectionIterator.java:48)
> at org.apache.manifoldcf.cmis_tests.APISanityTest.createTestArea(
> APISanityTest.java:139)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> FrameworkMethod.java:44)
> at org.junit.internal.runners.model.ReflectiveCallable.run(
> ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> FrameworkMethod.java:41)
> at org.junit.internal.runners.statements.RunBefores.evaluate(
> RunBefores.java:27)
> at org.junit.internal.runners.statements.RunAfters.evaluate(
> RunAfters.java:31)
> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
> BlockJUnit4ClassRunner.java:79)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:71)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> JUnit4TestReference.java:49)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:197)


Let me know if you have any hints!

Thank you again for your support.

Regards,

Piergiorgio

2011/8/3 Jens Hübel <jh...@opentext.com>

> Hi Pergiorio,
>
> do you have a code piece that I can take a look at? What is your client
> API? Do you connect to Chemistry client API (chemistry-opencmis-client-api)?
> Or perhaps you can grab the query sent from the log file?
>
> Thanks Jens
>
>
> -----Original Message-----
> From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com]
> Sent: Mittwoch, 3. August 2011 13:22
> To: dev@chemistry.apache.org
> Subject: Re: CMIS and Lucene
>
> Hi Jens,
>
> I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
> project implementing the CMIS Connector using OpenCMIS 0.4.0.
>
> Now I'm working on integration test trying to use the OpenCMIS InMemory
> Repository that is available from Apache Chemistry ;)
>
> I have some problems because now I'm finishing my test implementation but
> it
> seems that I can't execute queries on the InMemory Repository, it returns a
> null string in the convertStatusCode method.
>
> The CMIS Repository Connector that I implemented for ManifoldCF has a job
> parameter that is the CMIS Query, this parameter is used by agents to
> select
> all the contents that needs to be indexed on the Output Connector (for
> example Apache Solr).
> Without a query feature exposed by the InMemory Repository I can't test the
> connector in the right way.
>
> I tried to use the latest version of the InMemory Repository
> (0.5.0-SNAPSHOT) but with the same result.
>
> Have you got any ideas to solve this problem?
> Thank you for your support.
>
> Regards,
> Piergiorgio
>
>
> 2011/8/3 Jens Hübel <jh...@opentext.com>
>
> > Hi Chemistries,
> >
> >
> >
> > is anyone of us already involved in the Lucene project?
> >
> >
> >
> > Reading this here
> > http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
> >
> >
> >
> > I think it would make sense to give them an introduction to what we have.
> >
> >
> >
> > if I understand this correctly one of the options they discuss is to
> create
> > an InMemory mock server. It does not make much sense to duplicate what we
> > already have (and if we need getContentChanges() for that I am happy to
> > implement this).
> >
> >
> >
> > Jens
> >
> >
> >
> >
>
>
> --
> Piergiorgio Lucidi
> Web: http://about.me/piergiorgiolucidi
>



-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi

RE: CMIS and Lucene

Posted by Jens Hübel <jh...@opentext.com>.
Hi Pergiorio,

do you have a code piece that I can take a look at? What is your client API? Do you connect to Chemistry client API (chemistry-opencmis-client-api)? Or perhaps you can grab the query sent from the log file?

Thanks Jens


-----Original Message-----
From: Piergiorgio Lucidi [mailto:piergiorgiolucidi@gmail.com] 
Sent: Mittwoch, 3. August 2011 13:22
To: dev@chemistry.apache.org
Subject: Re: CMIS and Lucene

Hi Jens,

I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
project implementing the CMIS Connector using OpenCMIS 0.4.0.

Now I'm working on integration test trying to use the OpenCMIS InMemory
Repository that is available from Apache Chemistry ;)

I have some problems because now I'm finishing my test implementation but it
seems that I can't execute queries on the InMemory Repository, it returns a
null string in the convertStatusCode method.

The CMIS Repository Connector that I implemented for ManifoldCF has a job
parameter that is the CMIS Query, this parameter is used by agents to select
all the contents that needs to be indexed on the Output Connector (for
example Apache Solr).
Without a query feature exposed by the InMemory Repository I can't test the
connector in the right way.

I tried to use the latest version of the InMemory Repository
(0.5.0-SNAPSHOT) but with the same result.

Have you got any ideas to solve this problem?
Thank you for your support.

Regards,
Piergiorgio


2011/8/3 Jens Hübel <jh...@opentext.com>

> Hi Chemistries,
>
>
>
> is anyone of us already involved in the Lucene project?
>
>
>
> Reading this here
> http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
>
>
>
> I think it would make sense to give them an introduction to what we have.
>
>
>
> if I understand this correctly one of the options they discuss is to create
> an InMemory mock server. It does not make much sense to duplicate what we
> already have (and if we need getContentChanges() for that I am happy to
> implement this).
>
>
>
> Jens
>
>
>
>


-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi

Re: CMIS and Lucene

Posted by Piergiorgio Lucidi <pi...@gmail.com>.
Hi Jens,

I contributed to the Apache ManifoldCF (ex Lucene Connector Framework)
project implementing the CMIS Connector using OpenCMIS 0.4.0.

Now I'm working on integration test trying to use the OpenCMIS InMemory
Repository that is available from Apache Chemistry ;)

I have some problems because now I'm finishing my test implementation but it
seems that I can't execute queries on the InMemory Repository, it returns a
null string in the convertStatusCode method.

The CMIS Repository Connector that I implemented for ManifoldCF has a job
parameter that is the CMIS Query, this parameter is used by agents to select
all the contents that needs to be indexed on the Output Connector (for
example Apache Solr).
Without a query feature exposed by the InMemory Repository I can't test the
connector in the right way.

I tried to use the latest version of the InMemory Repository
(0.5.0-SNAPSHOT) but with the same result.

Have you got any ideas to solve this problem?
Thank you for your support.

Regards,
Piergiorgio


2011/8/3 Jens Hübel <jh...@opentext.com>

> Hi Chemistries,
>
>
>
> is anyone of us already involved in the Lucene project?
>
>
>
> Reading this here
> http://search-lucene.com/m/wI38e1K3BWJ&subj=Re+CMIS+Connector+Tests
>
>
>
> I think it would make sense to give them an introduction to what we have.
>
>
>
> if I understand this correctly one of the options they discuss is to create
> an InMemory mock server. It does not make much sense to duplicate what we
> already have (and if we need getContentChanges() for that I am happy to
> implement this).
>
>
>
> Jens
>
>
>
>


-- 
Piergiorgio Lucidi
Web: http://about.me/piergiorgiolucidi