You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Dave Brosius <db...@mebigfatguy.com> on 2014/02/20 17:45:15 UTC
NPE trying to session.getRootFolder
Greetings,
I am running into a NPE trying to get the root folder from an
Alfresco cmis thru chemistry 0.10.0.
I'm assuming that there is some sort of configuration missing on my
part, but i'm not sure how to debug further.
Basically, when calling Session.getRootFolder it gets to
SessionImpl getObject(ObjectId objectId, OperationContext context);
where it fetches ObjectData, that looks like this:
Object Data [properties=Properties Data
[properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId {null=cmis:allowedChildObjectTypeIds}: , {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId {null=cmis:objectTypeId}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: cmis:folder], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString {null=cmis:path}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: /], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString {null=cmis:name}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company Home], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime {null=cmis:creationDate}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: 2013-11-18T19:22:26.382+05:30], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString {null=cmis:changeToken}: , {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString {null=cmis:lastModifiedBy}:
[{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString {null=cmis:createdBy}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId {null=cmis:objectId}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId {null=cmis:baseTypeId}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: cmis:folder], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId {null=alfcmis:nodeRef}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime {null=cmis:lastModificationDate}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: 2013-11-18T19:44:23.898+05:30],
{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}: [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets, {http://www.alfresco.org}properties {}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString {propertyDefinitionId=app:icon}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: space-icon-default], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString {propertyDefinitionId=cm:description}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: The company root space], {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString {propertyDefinitionId=cmis:policyText}: , {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString {propertyDefinitionId=cm:title}: [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company Home]], {http://www.alfresco.org}appliedAspects {}: P:cm:titled, {http://www.alfresco.org}appliedAspects {}: P:sys:localized]]], allowable
actions=Allowable Actions [allowable actions=[CAN_UPDATE_PROPERTIES, CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES, CAN_GET_OBJECT_RELATIONSHIPS, CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES, CAN_GET_CHILDREN, CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER, CAN_CREATE_RELATIONSHIP, CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event info=null, ACL=null, is exact ACL=null, policy ids=null, relationships=[], renditions=[]][extensions=null]
It then switches on the objectData's baseTypeId
which uses the entry in the properties.properties object as
PropertyData<?> property =
properties.getProperties().get("cmis:baseTypeId");
but as you can see above the properties.properties collection is empty.
since the value returned is null, the switch NPEs on me.
So i'm not sure why the properties.properties collection is empty.
Any help would be greatly appreciated.
dave
--
<br type="_moz" />
Re: NPE trying to session.getRootFolder
Posted by Florian Müller <fm...@apache.org>.
Hi Dave,
It looks like a classloader issue.
Do you have to use the Web Services binding or can you switch to the
AtomPub binding? The AtomPub binding is less cumbersome and much faster.
Regards,
Florian
> It must be a classloader issue with some jar in wls, as this web app
> fails
>
> package com.suckage;
>
> import java.io.IOException;
> import java.net.Authenticator;
> import java.net.PasswordAuthentication;
> import java.util.HashMap;
> import java.util.List;
> import java.util.Map;
>
> import javax.servlet.ServletException;
> import javax.servlet.http.HttpServlet;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
>
> import org.apache.chemistry.opencmis.client.api.Folder;
> import org.apache.chemistry.opencmis.client.api.Repository;
> import org.apache.chemistry.opencmis.client.api.Session;
> import
> org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
> import
> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
> import org.apache.chemistry.opencmis.commons.SessionParameter;
> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>
> public class CmisServlet extends HttpServlet {
>
> private Repository repository = null;
> private Session session = null;
>
> @Override
> public void init() throws ServletException {
> super.init();
>
> List<Repository> repositories =
> SessionFactoryImpl.newInstance().getRepositories(getProps());
>
> for (Repository rep : repositories) {
> if (rep.getName().equalsIgnoreCase("Main Repository")) {
> repository = rep;
> break;
> }
> }
>
> session = repository.createSession();
> }
>
> @Override
> protected void doGet(HttpServletRequest request,
> HttpServletResponse response)
> throws ServletException, IOException {
>
> if (session != null) {
> Folder f = session.getRootFolder();
>
> response.setStatus(HttpServletResponse.SC_OK);
>
> response.getOutputStream().write(f.getName().getBytes("UTF-8"));
> }
> }
>
> private static Map<String, String> getProps() {
> String wsdl =
> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>
> Map<String, String> properties = new HashMap<String,
> String>();
> properties.put(SessionParameter.BINDING_TYPE,
> BindingType.WEBSERVICES.value());
> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE,
> wsdl);
>
> String username = "xxx";
> String password = "yyy";
>
>
> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>
> properties.put(SessionParameter.USER, username);
> properties.put(SessionParameter.PASSWORD, password);
>
> Authenticator.setDefault(new BasicAuthenticator(username,
> password));
>
> return properties;
> }
>
> static class BasicAuthenticator extends Authenticator
> {
> private PasswordAuthentication passwordAuthentication;
>
> public BasicAuthenticator(String user, String password)
> {
> passwordAuthentication = new PasswordAuthentication(user,
> password.toCharArray());
> }
>
> @Override
> protected synchronized PasswordAuthentication
> getPasswordAuthentication()
> {
> return passwordAuthentication;
> }
> }
> }
>
> and this standalone succeeds
>
> import java.net.Authenticator;
> import java.net.PasswordAuthentication;
> import java.util.HashMap;
> import java.util.List;
> import java.util.Map;
>
> import org.apache.chemistry.opencmis.client.api.Folder;
> import org.apache.chemistry.opencmis.client.api.Repository;
> import org.apache.chemistry.opencmis.client.api.Session;
> import
> org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
> import
> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
> import org.apache.chemistry.opencmis.commons.SessionParameter;
> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>
>
> public class Al {
>
> public static void main(String[] args) {
>
> Map<String, String> props = getProps();
>
> List<Repository> repositories =
> SessionFactoryImpl.newInstance().getRepositories(props);
>
> Repository repository = null;
> for (Repository rep : repositories) {
> if (rep.getName().equalsIgnoreCase("Main Repository")) {
> repository = rep;
> break;
> }
> }
>
> if (repository != null) {
> Session session = repository.createSession();
>
> Folder f = session.getRootFolder();
> System.out.println(f.getName());
> }
> }
>
> private static Map<String, String> getProps() {
> String wsdl =
> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>
> Map<String, String> properties = new HashMap<String,
> String>();
> properties.put(SessionParameter.BINDING_TYPE,
> BindingType.WEBSERVICES.value());
> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE,
> wsdl);
>
> String username = "xxx";
> String password = "yyy";
>
>
> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>
> properties.put(SessionParameter.USER, username);
> properties.put(SessionParameter.PASSWORD, password);
>
> Authenticator.setDefault(new BasicAuthenticator(username,
> password));
>
> return properties;
> }
>
> }
>
> class BasicAuthenticator extends Authenticator
> {
> private PasswordAuthentication passwordAuthentication;
>
> public BasicAuthenticator(String user, String password)
> {
> passwordAuthentication = new PasswordAuthentication(user,
> password.toCharArray());
> }
>
> @Override
> protected synchronized PasswordAuthentication
> getPasswordAuthentication()
> {
> return passwordAuthentication;
> }
> }
>
>
> i even added <prefer-application-packages> like the following to try
> to use my copies of the jars in weblogic-application.xml
>
> <prefer-application-packages>
> <package-name>org.apache.chemistry.*</package-name>
> <package-name>com.glassfish.gmbal.*</package-name>
> <package-name>com.sun.istack.*</package-name>
> <package-name>com.sun.xml.stream.*</package-name>
> <package-name>com.sun.xml.ws.*</package-name>
> <package-name>com.sun.xml.bind.*</package-name>
> <package-name>com.sun.xml.txw2.*</package-name>
> <package-name>org.jvnet.*</package-name>
> <package-name>javax.xml.bind.*</package-name>
> <package-name>javax.xml.ws.*</package-name>
> </prefer-application-packages>
>
>
>
>
>
> ---
> <br type="_moz" />
>
> On 2014-02-20 14:10, Dave Brosius wrote:
>> I'm using
>> Alfresco Community v4.0.0
>> (4003) schema 5025
>> The web service url is
>>
>> http://some.local.host.com:9080/alfresco/cmisws/RepositoryService?wsdl
>>
>> I decided to build a standalone app that just tested that one thing,
>> so it would be easier to test (the real thing is part of a web app
>> on
>> weblogic)
>> It works fine in the standalone app. I'm now thinking that it's a
>> quiet jar conflict, as i had to download a bunch of jars that
>> apparently
>> wls was providing.
>> I'm going to stuff all the jars i downloaded into WEB-INF/lib and
>> see
>> what happens.
>> ---
>> <br type="_moz" />
>> On 2014-02-20 11:56, Florian Müller wrote:
>>> Hi Dave,
>>> Looks like the transferred XML is somehow corrupt. All properties
>>> became extensions.
>>> Would it be possible to capture the response from the Alfresco
>>> server?
>>> Which Alfresco version are you connection to and which Alfresco
>>> CMIS
>>> URL did you use?
>>>
>>> Thanks,
>>> Florian
>>>
>>>
>>>
>>>> Greetings,
>>>> I am running into a NPE trying to get the root folder from an
>>>> Alfresco cmis thru chemistry 0.10.0.
>>>> I'm assuming that there is some sort of configuration missing on
>>>> my
>>>> part, but i'm not sure how to debug further.
>>>> Basically, when calling Session.getRootFolder it gets to
>>>> SessionImpl getObject(ObjectId objectId, OperationContext
>>>> context);
>>>> where it fetches ObjectData, that looks like this:
>>>> Object Data [properties=Properties Data
>>>>
>>>> [properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=cmis:allowedChildObjectTypeIds}: ,
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=cmis:objectTypeId}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> cmis:folder],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {null=cmis:path}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: /],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {null=cmis:name}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> Company
>>>> Home],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>> {null=cmis:creationDate}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> 2013-11-18T19:22:26.382+05:30],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {null=cmis:changeToken}: ,
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {null=cmis:lastModifiedBy}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> System],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {null=cmis:createdBy}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> System],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=cmis:objectId}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=cmis:baseTypeId}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> cmis:folder],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=alfcmis:nodeRef}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>> {null=cmis:lastModificationDate}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> 2013-11-18T19:44:23.898+05:30],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}:
>>>> [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets,
>>>> {http://www.alfresco.org}properties {}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {propertyDefinitionId=app:icon}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> space-icon-default],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {propertyDefinitionId=cm:description}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: The
>>>> company root space],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {propertyDefinitionId=cmis:policyText}: ,
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {propertyDefinitionId=cm:title}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> Company
>>>> Home]], {http://www.alfresco.org}appliedAspects {}: P:cm:titled,
>>>> {http://www.alfresco.org}appliedAspects {}: P:sys:localized]]],
>>>> allowable
>>>> actions=Allowable Actions [allowable
>>>> actions=[CAN_UPDATE_PROPERTIES,
>>>> CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES,
>>>> CAN_GET_OBJECT_RELATIONSHIPS,
>>>> CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES, CAN_GET_CHILDREN,
>>>> CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER, CAN_CREATE_RELATIONSHIP,
>>>> CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event
>>>> info=null,
>>>> ACL=null, is exact ACL=null, policy ids=null, relationships=[],
>>>> renditions=[]][extensions=null]
>>>> It then switches on the objectData's baseTypeId
>>>> which uses the entry in the properties.properties object as
>>>> PropertyData<?> property =
>>>> properties.getProperties().get("cmis:baseTypeId");
>>>> but as you can see above the properties.properties collection is
>>>> empty.
>>>> since the value returned is null, the switch NPEs on me.
>>>> So i'm not sure why the properties.properties collection is empty.
>>>> Any help would be greatly appreciated.
>>>> dave
Re: NPE trying to session.getRootFolder
Posted by Florian Müller <fm...@apache.org>.
Thanks for sharing your findings!
- Florian
> Yeah!! I fixed it.
>
> For posterity, and any other poor souls that need to get this working
> on
> weblogic 12c, embellish your weblogic-application.xml with the
> following
>
> <prefer-application-packages>
> <package-name>com.sun.istack.*</package-name>
> <package-name>com.sun.xml.*</package-name>
> <package-name>javax.xml.bind.*</package-name>
> <package-name>javax.xml.soap.*</package-name>
> <package-name>javax.xml.ws.*</package-name>
> <package-name>org.glassfish.gmbal.*</package-name>
> <package-name>org.jvnet.mimepull.*</package-name>
> <package-name>org.jvnet.staxex.*</package-name>
> </prefer-application-packages>
>
> <prefer-application-resources>
> <resource-name>javax.xml.ws.*</resource-name>
> <resource-name>com.sun.xml.ws.*</resource-name>
> <resource-name>javax.xml.soap.*</resource-name>
>
>
> <resource-name>META-INF/services/javax.xml.ws.spi.Provider</resource-name>
>
>
> <resource-name>META-INF/services/com.sun.xml.ws.api.client.ServiceInterceptorFactory</resource-name>
>
>
> <resource-name>META-INF/services/com.sun.xml.ws.api.wsdl.parser.WSDLParserExtension</resource-name>
>
>
> <resource-name>META-INF/services/javax.xml.soap.MetaFactory</resource-name>
>
>
> <resource-name>META-INF/services/javax.xml.soap.SOAPFactory</resource-name>
>
>
> <resource-name>META-INF/services/javax.xml.soap.SOAPConnectionFactory</resource-name>
>
>
> <resource-name>META-INF/services/javax.xml.soap.MessageFactory</resource-name>
>
>
> <resource-name>META-INF/services/javax.xml.bind.JAXBContext</resource-name>
>
>
> <resource-name>META-INF/services/com.sun.xml.ws.spi.db.DatabindingProvider</resource-name>
>
>
> <resource-name>META-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory</resource-name>
> </prefer-application-resources>
>
> thanks for the help.
> dave
>
> ---
> <br type="_moz" />
>
> On 2014-02-21 11:59, Dave Brosius wrote:
>
>> In jaxws-rt-2.2.6-6.jar, the code
>>
>> com.sun.xml.ws.api.client.ServiceInterceptorFactory.java
>>
>> method
>>
>> public static @NotNull ServiceInterceptor load(@NotNull WSService
>> service, @Nullable ClassLoader cl) {
>> List<ServiceInterceptor> l = new ArrayList<ServiceInterceptor>();
>>
>> // first service look-up
>> for( ServiceInterceptorFactory f :
>> ServiceFinder.find(ServiceInterceptorFactory.class))
>> l.add(f.create(service));
>>
>> // then thread-local
>> for( ServiceInterceptorFactory f : threadLocalFactories.get())
>> l.add(f.create(service));
>>
>> return ServiceInterceptor.aggregate(l.toArray(new
>> ServiceInterceptor[l.size()]));
>> }
>>
>> SHOULD PROBABLY BE
>>
>> public static @NotNull ServiceInterceptor load(@NotNull WSService
>> service, @Nullable ClassLoader cl) {
>> List<ServiceInterceptor> l = new ArrayList<ServiceInterceptor>();
>>
>> // first service look-up
>> for( Object f : ServiceFinder.find(ServiceInterceptorFactory.class))
>> {
>> if (f instanceof ServiceInterceptorFactory)
>> l.add(f.create(service));
>> }
>>
>> // then thread-local
>> for( ServiceInterceptorFactory f : threadLocalFactories.get())
>> l.add(f.create(service));
>>
>> return ServiceInterceptor.aggregate(l.toArray(new
>> ServiceInterceptor[l.size()]));
>> }
>>
>> ---
>> <br type="_moz" />
>>
>> On 2014-02-21 11:41, Dave Brosius wrote:
>>> Caused by: java.lang.ClassCastException: Cannot cast
>>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
>>> com.sun.xml.ws.api.client.ServiceInterceptorFactory
>>> at java.lang.Class.cast(Class.java:3094)
>>> at
>>> com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:460)
>>> at
>>>
>>> com.sun.xml.ws.util.ServiceFinder$CompositeIterator.next(ServiceFinder.java:402)
>>> at
>>>
>>> com.sun.xml.ws.api.client.ServiceInterceptorFactory.load(ServiceInterceptorFactory.java:84)
>>> at
>>> com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:245)
>>> at
>>> com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:205)
>>> at
>>> com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:195)
>>> at
>>> com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:112)
>>> at javax.xml.ws.Service.<init>(Service.java:92)
>>> at
>>>
>>> org.apache.chemistry.opencmis.commons.impl.jaxb.RepositoryService.<init>(RepositoryService.java:46)
>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>> Method)
>>> at
>>>
>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>>> at
>>>
>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>>> at
>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider$CmisServiceHolder.createServiceObject(AbstractPortProvider.java:200)
>>> at
>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider$CmisServiceHolder.<init>(AbstractPortProvider.java:187)
>>> at
>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.initServiceObject(AbstractPortProvider.java:514)
>>> at
>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getPortObject(AbstractPortProvider.java:454)
>>> at
>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getRepositoryServicePort(AbstractPortProvider.java:280)
>>> at
>>>
>>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:69)
>>> at
>>>
>>> org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:85)
>>> at
>>>
>>> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:109)
>>> at
>>>
>>> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:96)
>>>
>>>
>>>
>>> com.sun.xml.ws.api.client.ServiceInterceptorFactory: Provider
>>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory is specified
>>> in
>>>
>>> jar:file:/home/dave/Oracle/Middleware/Oracle_Home/oracle_common/modules/com.oracle.webservices.wls.wls-ws-metainf-services_2.0.0.0.jar!/META-INF/services/com.sun.xml.ws.api.client.ServiceInterceptorFactorybut
>>> could not be instantiated: java.lang.ClassCastException: Cannot cast
>>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
>>> com.sun.xml.ws.api.client.ServiceInterceptorFactory
>>>
>>>
>>>
>>>
>>> ---
>>> <br type="_moz" />
>>>
>>> On 2014-02-21 11:32, Dave Brosius wrote:
>>>> I've added more to paths to my <prefer-application-packages> in my
>>>> ear
>>>>
>>>>
>>>> and now i get
>>>>
>>>> Caused by: java.lang.ClassCastException: Cannot cast
>>>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
>>>> com.sun.xml.ws.api.client.ServiceInterceptorFactory
>>>>
>>>> Now this SPI is found in jaxws-rt-2.2.26-6.jar and is
>>>> javax.xml.ws.spi.Provider=com.sun.xml.ws.spi.ProviderImpl there
>>>>
>>>> and i have
>>>>
>>>> <prefer-application-packages>
>>>> <package-name>javax.xml.ws.*</package-name>
>>>> ....
>>>>
>>>>
>>>> in my weblogic-application.xml in my ear, so it should be using
>>>> that
>>>> jar. But yet it is still picking up WLSServiceInterceptorFactory
>>>> thru
>>>> spi somehow.
>>>>
>>>> Anyone know what my problem is?
>>>>
>>>>
>>>> ---
>>>> <br type="_moz" />
>>>>
>>>> On 2014-02-20 17:08, Dave Brosius wrote:
>>>>> It must be a classloader issue with some jar in wls, as this web
>>>>> app fails
>>>>>
>>>>> package com.suckage;
>>>>>
>>>>> import java.io.IOException;
>>>>> import java.net.Authenticator;
>>>>> import java.net.PasswordAuthentication;
>>>>> import java.util.HashMap;
>>>>> import java.util.List;
>>>>> import java.util.Map;
>>>>>
>>>>> import javax.servlet.ServletException;
>>>>> import javax.servlet.http.HttpServlet;
>>>>> import javax.servlet.http.HttpServletRequest;
>>>>> import javax.servlet.http.HttpServletResponse;
>>>>>
>>>>> import org.apache.chemistry.opencmis.client.api.Folder;
>>>>> import org.apache.chemistry.opencmis.client.api.Repository;
>>>>> import org.apache.chemistry.opencmis.client.api.Session;
>>>>> import
>>>>> org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
>>>>> import
>>>>> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
>>>>> import org.apache.chemistry.opencmis.commons.SessionParameter;
>>>>> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>>>>>
>>>>> public class CmisServlet extends HttpServlet {
>>>>>
>>>>> private Repository repository = null;
>>>>> private Session session = null;
>>>>>
>>>>> @Override
>>>>> public void init() throws ServletException {
>>>>> super.init();
>>>>>
>>>>> List<Repository> repositories =
>>>>> SessionFactoryImpl.newInstance().getRepositories(getProps());
>>>>>
>>>>> for (Repository rep : repositories) {
>>>>> if (rep.getName().equalsIgnoreCase("Main Repository")) {
>>>>> repository = rep;
>>>>> break;
>>>>> }
>>>>> }
>>>>>
>>>>> session = repository.createSession();
>>>>> }
>>>>>
>>>>> @Override
>>>>> protected void doGet(HttpServletRequest request,
>>>>> HttpServletResponse response)
>>>>> throws ServletException, IOException {
>>>>>
>>>>> if (session != null) {
>>>>> Folder f = session.getRootFolder();
>>>>>
>>>>> response.setStatus(HttpServletResponse.SC_OK);
>>>>> response.getOutputStream().write(f.getName().getBytes("UTF-8"));
>>>>> }
>>>>> }
>>>>>
>>>>> private static Map<String, String> getProps() {
>>>>> String wsdl =
>>>>>
>>>>> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>>>>>
>>>>> Map<String, String> properties = new HashMap<String, String>();
>>>>> properties.put(SessionParameter.BINDING_TYPE,
>>>>> BindingType.WEBSERVICES.value());
>>>>> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE,
>>>>> wsdl);
>>>>>
>>>>> String username = "xxx";
>>>>> String password = "yyy";
>>>>>
>>>>> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
>>>>> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>>>>>
>>>>> properties.put(SessionParameter.USER, username);
>>>>> properties.put(SessionParameter.PASSWORD, password);
>>>>>
>>>>> Authenticator.setDefault(new BasicAuthenticator(username,
>>>>> password));
>>>>>
>>>>> return properties;
>>>>> }
>>>>>
>>>>> static class BasicAuthenticator extends Authenticator
>>>>> {
>>>>> private PasswordAuthentication passwordAuthentication;
>>>>>
>>>>> public BasicAuthenticator(String user, String password)
>>>>> {
>>>>> passwordAuthentication = new PasswordAuthentication(user,
>>>>> password.toCharArray());
>>>>> }
>>>>>
>>>>> @Override
>>>>> protected synchronized PasswordAuthentication
>>>>> getPasswordAuthentication()
>>>>> {
>>>>> return passwordAuthentication;
>>>>> }
>>>>> }
>>>>> }
>>>>>
>>>>> and this standalone succeeds
>>>>>
>>>>> import java.net.Authenticator;
>>>>> import java.net.PasswordAuthentication;
>>>>> import java.util.HashMap;
>>>>> import java.util.List;
>>>>> import java.util.Map;
>>>>>
>>>>> import org.apache.chemistry.opencmis.client.api.Folder;
>>>>> import org.apache.chemistry.opencmis.client.api.Repository;
>>>>> import org.apache.chemistry.opencmis.client.api.Session;
>>>>> import
>>>>> org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
>>>>> import
>>>>> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
>>>>> import org.apache.chemistry.opencmis.commons.SessionParameter;
>>>>> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>>>>>
>>>>>
>>>>> public class Al {
>>>>>
>>>>> public static void main(String[] args) {
>>>>>
>>>>> Map<String, String> props = getProps();
>>>>>
>>>>> List<Repository> repositories =
>>>>> SessionFactoryImpl.newInstance().getRepositories(props);
>>>>>
>>>>> Repository repository = null;
>>>>> for (Repository rep : repositories) {
>>>>> if (rep.getName().equalsIgnoreCase("Main Repository")) {
>>>>> repository = rep;
>>>>> break;
>>>>> }
>>>>> }
>>>>>
>>>>> if (repository != null) {
>>>>> Session session = repository.createSession();
>>>>>
>>>>> Folder f = session.getRootFolder();
>>>>> System.out.println(f.getName());
>>>>> }
>>>>> }
>>>>>
>>>>> private static Map<String, String> getProps() {
>>>>> String wsdl =
>>>>>
>>>>> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>>>>>
>>>>> Map<String, String> properties = new HashMap<String, String>();
>>>>> properties.put(SessionParameter.BINDING_TYPE,
>>>>> BindingType.WEBSERVICES.value());
>>>>> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE,
>>>>> wsdl);
>>>>> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE,
>>>>> wsdl);
>>>>>
>>>>> String username = "xxx";
>>>>> String password = "yyy";
>>>>>
>>>>> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
>>>>> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>>>>>
>>>>> properties.put(SessionParameter.USER, username);
>>>>> properties.put(SessionParameter.PASSWORD, password);
>>>>>
>>>>> Authenticator.setDefault(new BasicAuthenticator(username,
>>>>> password));
>>>>>
>>>>> return properties;
>>>>> }
>>>>>
>>>>> }
>>>>>
>>>>> class BasicAuthenticator extends Authenticator
>>>>> {
>>>>> private PasswordAuthentication passwordAuthentication;
>>>>>
>>>>> public BasicAuthenticator(String user, String password)
>>>>> {
>>>>> passwordAuthentication = new PasswordAuthentication(user,
>>>>> password.toCharArray());
>>>>> }
>>>>>
>>>>> @Override
>>>>> protected synchronized PasswordAuthentication
>>>>> getPasswordAuthentication()
>>>>> {
>>>>> return passwordAuthentication;
>>>>> }
>>>>> }
>>>>>
>>>>>
>>>>> i even added <prefer-application-packages> like the following to
>>>>> try
>>>>> to use my copies of the jars in weblogic-application.xml
>>>>>
>>>>> <prefer-application-packages>
>>>>> <package-name>org.apache.chemistry.*</package-name>
>>>>> <package-name>com.glassfish.gmbal.*</package-name>
>>>>> <package-name>com.sun.istack.*</package-name>
>>>>> <package-name>com.sun.xml.stream.*</package-name>
>>>>> <package-name>com.sun.xml.ws.*</package-name>
>>>>> <package-name>com.sun.xml.bind.*</package-name>
>>>>> <package-name>com.sun.xml.txw2.*</package-name>
>>>>> <package-name>org.jvnet.*</package-name>
>>>>> <package-name>javax.xml.bind.*</package-name>
>>>>> <package-name>javax.xml.ws.*</package-name>
>>>>> </prefer-application-packages>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ---
>>>>> <br type="_moz" />
>>>>>
>>>>> On 2014-02-20 14:10, Dave Brosius wrote:
>>>>>> I'm using
>>>>>>
>>>>>> Alfresco Community v4.0.0
>>>>>> (4003) schema 5025
>>>>>>
>>>>>> The web service url is
>>>>>>
>>>>>>
>>>>>> http://some.local.host.com:9080/alfresco/cmisws/RepositoryService?wsdl
>>>>>>
>>>>>>
>>>>>> I decided to build a standalone app that just tested that one
>>>>>> thing,
>>>>>> so it would be easier to test (the real thing is part of a web
>>>>>> app on
>>>>>> weblogic)
>>>>>>
>>>>>> It works fine in the standalone app. I'm now thinking that it's
>>>>>> a
>>>>>> quiet jar conflict, as i had to download a bunch of jars that
>>>>>> apparently
>>>>>> wls was providing.
>>>>>>
>>>>>> I'm going to stuff all the jars i downloaded into WEB-INF/lib
>>>>>> and see
>>>>>> what happens.
>>>>>>
>>>>>> ---
>>>>>> <br type="_moz" />
>>>>>>
>>>>>> On 2014-02-20 11:56, Florian Müller wrote:
>>>>>>> Hi Dave,
>>>>>>>
>>>>>>> Looks like the transferred XML is somehow corrupt. All
>>>>>>> properties
>>>>>>> became extensions.
>>>>>>> Would it be possible to capture the response from the Alfresco
>>>>>>> server?
>>>>>>> Which Alfresco version are you connection to and which Alfresco
>>>>>>> CMIS
>>>>>>> URL did you use?
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Florian
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Greetings,
>>>>>>>>
>>>>>>>> I am running into a NPE trying to get the root folder from an
>>>>>>>> Alfresco cmis thru chemistry 0.10.0.
>>>>>>>>
>>>>>>>> I'm assuming that there is some sort of configuration missing
>>>>>>>> on my
>>>>>>>> part, but i'm not sure how to debug further.
>>>>>>>>
>>>>>>>> Basically, when calling Session.getRootFolder it gets to
>>>>>>>>
>>>>>>>> SessionImpl getObject(ObjectId objectId, OperationContext
>>>>>>>> context);
>>>>>>>>
>>>>>>>> where it fetches ObjectData, that looks like this:
>>>>>>>>
>>>>>>>> Object Data [properties=Properties Data
>>>>>>>>
>>>>>>>>
>>>>>>>> [properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>>> {null=cmis:allowedChildObjectTypeIds}: ,
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>>> {null=cmis:objectTypeId}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> cmis:folder],
>>>>>>>>
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>>> {null=cmis:path}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> /],
>>>>>>>>
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>>> {null=cmis:name}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> Company
>>>>>>>> Home],
>>>>>>>>
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>>>>>> {null=cmis:creationDate}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> 2013-11-18T19:22:26.382+05:30],
>>>>>>>>
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>>> {null=cmis:changeToken}: ,
>>>>>>>>
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>>> {null=cmis:lastModifiedBy}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> System],
>>>>>>>>
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>>> {null=cmis:createdBy}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> System],
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>>> {null=cmis:objectId}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>>> {null=cmis:baseTypeId}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> cmis:folder],
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>>> {null=alfcmis:nodeRef}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>>>>>>
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>>>>>> {null=cmis:lastModificationDate}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> 2013-11-18T19:44:23.898+05:30],
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>>> {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}:
>>>>>>>> [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets,
>>>>>>>> {http://www.alfresco.org}properties {}:
>>>>>>>>
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>>> {propertyDefinitionId=app:icon}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> space-icon-default],
>>>>>>>>
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>>> {propertyDefinitionId=cm:description}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> The
>>>>>>>> company root space],
>>>>>>>>
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>>> {propertyDefinitionId=cmis:policyText}: ,
>>>>>>>>
>>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>>> {propertyDefinitionId=cm:title}:
>>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>>> Company
>>>>>>>> Home]], {http://www.alfresco.org}appliedAspects {}:
>>>>>>>> P:cm:titled,
>>>>>>>> {http://www.alfresco.org}appliedAspects {}:
>>>>>>>> P:sys:localized]]],
>>>>>>>> allowable
>>>>>>>> actions=Allowable Actions [allowable
>>>>>>>> actions=[CAN_UPDATE_PROPERTIES,
>>>>>>>> CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES,
>>>>>>>> CAN_GET_OBJECT_RELATIONSHIPS,
>>>>>>>> CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES,
>>>>>>>> CAN_GET_CHILDREN,
>>>>>>>> CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER,
>>>>>>>> CAN_CREATE_RELATIONSHIP,
>>>>>>>> CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event
>>>>>>>> info=null,
>>>>>>>> ACL=null, is exact ACL=null, policy ids=null,
>>>>>>>> relationships=[],
>>>>>>>> renditions=[]][extensions=null]
>>>>>>>>
>>>>>>>> It then switches on the objectData's baseTypeId
>>>>>>>>
>>>>>>>> which uses the entry in the properties.properties object as
>>>>>>>>
>>>>>>>> PropertyData<?> property =
>>>>>>>> properties.getProperties().get("cmis:baseTypeId");
>>>>>>>>
>>>>>>>> but as you can see above the properties.properties collection
>>>>>>>> is empty.
>>>>>>>>
>>>>>>>> since the value returned is null, the switch NPEs on me.
>>>>>>>>
>>>>>>>> So i'm not sure why the properties.properties collection is
>>>>>>>> empty.
>>>>>>>>
>>>>>>>> Any help would be greatly appreciated.
>>>>>>>>
>>>>>>>> dave
Re: NPE trying to session.getRootFolder
Posted by Dave Brosius <db...@mebigfatguy.com>.
Yeah!! I fixed it.
For posterity, and any other poor souls that need to get this working on
weblogic 12c, embellish your weblogic-application.xml with the following
<prefer-application-packages>
<package-name>com.sun.istack.*</package-name>
<package-name>com.sun.xml.*</package-name>
<package-name>javax.xml.bind.*</package-name>
<package-name>javax.xml.soap.*</package-name>
<package-name>javax.xml.ws.*</package-name>
<package-name>org.glassfish.gmbal.*</package-name>
<package-name>org.jvnet.mimepull.*</package-name>
<package-name>org.jvnet.staxex.*</package-name>
</prefer-application-packages>
<prefer-application-resources>
<resource-name>javax.xml.ws.*</resource-name>
<resource-name>com.sun.xml.ws.*</resource-name>
<resource-name>javax.xml.soap.*</resource-name>
<resource-name>META-INF/services/javax.xml.ws.spi.Provider</resource-name>
<resource-name>META-INF/services/com.sun.xml.ws.api.client.ServiceInterceptorFactory</resource-name>
<resource-name>META-INF/services/com.sun.xml.ws.api.wsdl.parser.WSDLParserExtension</resource-name>
<resource-name>META-INF/services/javax.xml.soap.MetaFactory</resource-name>
<resource-name>META-INF/services/javax.xml.soap.SOAPFactory</resource-name>
<resource-name>META-INF/services/javax.xml.soap.SOAPConnectionFactory</resource-name>
<resource-name>META-INF/services/javax.xml.soap.MessageFactory</resource-name>
<resource-name>META-INF/services/javax.xml.bind.JAXBContext</resource-name>
<resource-name>META-INF/services/com.sun.xml.ws.spi.db.DatabindingProvider</resource-name>
<resource-name>META-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory</resource-name>
</prefer-application-resources>
thanks for the help.
dave
---
<br type="_moz" />
On 2014-02-21 11:59, Dave Brosius wrote:
> In jaxws-rt-2.2.6-6.jar, the code
>
> com.sun.xml.ws.api.client.ServiceInterceptorFactory.java
>
> method
>
> public static @NotNull ServiceInterceptor load(@NotNull WSService service, @Nullable ClassLoader cl) {
> List<ServiceInterceptor> l = new ArrayList<ServiceInterceptor>();
>
> // first service look-up
> for( ServiceInterceptorFactory f : ServiceFinder.find(ServiceInterceptorFactory.class))
> l.add(f.create(service));
>
> // then thread-local
> for( ServiceInterceptorFactory f : threadLocalFactories.get())
> l.add(f.create(service));
>
> return ServiceInterceptor.aggregate(l.toArray(new ServiceInterceptor[l.size()]));
> }
>
> SHOULD PROBABLY BE
>
> public static @NotNull ServiceInterceptor load(@NotNull WSService service, @Nullable ClassLoader cl) {
> List<ServiceInterceptor> l = new ArrayList<ServiceInterceptor>();
>
> // first service look-up
> for( Object f : ServiceFinder.find(ServiceInterceptorFactory.class)) {
> if (f instanceof ServiceInterceptorFactory)
> l.add(f.create(service));
> }
>
> // then thread-local
> for( ServiceInterceptorFactory f : threadLocalFactories.get())
> l.add(f.create(service));
>
> return ServiceInterceptor.aggregate(l.toArray(new ServiceInterceptor[l.size()]));
> }
>
> ---
> <br type="_moz" />
>
> On 2014-02-21 11:41, Dave Brosius wrote:
>> Caused by: java.lang.ClassCastException: Cannot cast
>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
>> com.sun.xml.ws.api.client.ServiceInterceptorFactory
>> at java.lang.Class.cast(Class.java:3094)
>> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:460)
>> at
>> com.sun.xml.ws.util.ServiceFinder$CompositeIterator.next(ServiceFinder.java:402)
>> at
>> com.sun.xml.ws.api.client.ServiceInterceptorFactory.load(ServiceInterceptorFactory.java:84)
>> at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:245)
>> at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:205)
>> at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:195)
>> at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:112)
>> at javax.xml.ws.Service.<init>(Service.java:92)
>> at
>> org.apache.chemistry.opencmis.commons.impl.jaxb.RepositoryService.<init>(RepositoryService.java:46)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>> at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>> at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider$CmisServiceHolder.createServiceObject(AbstractPortProvider.java:200)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider$CmisServiceHolder.<init>(AbstractPortProvider.java:187)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.initServiceObject(AbstractPortProvider.java:514)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getPortObject(AbstractPortProvider.java:454)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getRepositoryServicePort(AbstractPortProvider.java:280)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:69)
>> at
>> org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:85)
>> at
>> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:109)
>> at
>> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:96)
>>
>>
>>
>> com.sun.xml.ws.api.client.ServiceInterceptorFactory: Provider
>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory is specified in
>> jar:file:/home/dave/Oracle/Middleware/Oracle_Home/oracle_common/modules/com.oracle.webservices.wls.wls-ws-metainf-services_2.0.0.0.jar!/META-INF/services/com.sun.xml.ws.api.client.ServiceInterceptorFactorybut could not be instantiated: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to com.sun.xml.ws.api.client.ServiceInterceptorFactory
>>
>>
>>
>>
>> ---
>> <br type="_moz" />
>>
>> On 2014-02-21 11:32, Dave Brosius wrote:
>>> I've added more to paths to my <prefer-application-packages> in my ear
>>>
>>>
>>> and now i get
>>>
>>> Caused by: java.lang.ClassCastException: Cannot cast
>>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
>>> com.sun.xml.ws.api.client.ServiceInterceptorFactory
>>>
>>> Now this SPI is found in jaxws-rt-2.2.26-6.jar and is
>>> javax.xml.ws.spi.Provider=com.sun.xml.ws.spi.ProviderImpl there
>>>
>>> and i have
>>>
>>> <prefer-application-packages>
>>> <package-name>javax.xml.ws.*</package-name>
>>> ....
>>>
>>>
>>> in my weblogic-application.xml in my ear, so it should be using that
>>> jar. But yet it is still picking up WLSServiceInterceptorFactory thru
>>> spi somehow.
>>>
>>> Anyone know what my problem is?
>>>
>>>
>>> ---
>>> <br type="_moz" />
>>>
>>> On 2014-02-20 17:08, Dave Brosius wrote:
>>>> It must be a classloader issue with some jar in wls, as this web app fails
>>>>
>>>> package com.suckage;
>>>>
>>>> import java.io.IOException;
>>>> import java.net.Authenticator;
>>>> import java.net.PasswordAuthentication;
>>>> import java.util.HashMap;
>>>> import java.util.List;
>>>> import java.util.Map;
>>>>
>>>> import javax.servlet.ServletException;
>>>> import javax.servlet.http.HttpServlet;
>>>> import javax.servlet.http.HttpServletRequest;
>>>> import javax.servlet.http.HttpServletResponse;
>>>>
>>>> import org.apache.chemistry.opencmis.client.api.Folder;
>>>> import org.apache.chemistry.opencmis.client.api.Repository;
>>>> import org.apache.chemistry.opencmis.client.api.Session;
>>>> import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
>>>> import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
>>>> import org.apache.chemistry.opencmis.commons.SessionParameter;
>>>> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>>>>
>>>> public class CmisServlet extends HttpServlet {
>>>>
>>>> private Repository repository = null;
>>>> private Session session = null;
>>>>
>>>> @Override
>>>> public void init() throws ServletException {
>>>> super.init();
>>>>
>>>> List<Repository> repositories =
>>>> SessionFactoryImpl.newInstance().getRepositories(getProps());
>>>>
>>>> for (Repository rep : repositories) {
>>>> if (rep.getName().equalsIgnoreCase("Main Repository")) {
>>>> repository = rep;
>>>> break;
>>>> }
>>>> }
>>>>
>>>> session = repository.createSession();
>>>> }
>>>>
>>>> @Override
>>>> protected void doGet(HttpServletRequest request,
>>>> HttpServletResponse response)
>>>> throws ServletException, IOException {
>>>>
>>>> if (session != null) {
>>>> Folder f = session.getRootFolder();
>>>>
>>>> response.setStatus(HttpServletResponse.SC_OK);
>>>> response.getOutputStream().write(f.getName().getBytes("UTF-8"));
>>>> }
>>>> }
>>>>
>>>> private static Map<String, String> getProps() {
>>>> String wsdl =
>>>> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>>>>
>>>> Map<String, String> properties = new HashMap<String, String>();
>>>> properties.put(SessionParameter.BINDING_TYPE,
>>>> BindingType.WEBSERVICES.value());
>>>> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, wsdl);
>>>>
>>>> String username = "xxx";
>>>> String password = "yyy";
>>>>
>>>> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
>>>> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>>>>
>>>> properties.put(SessionParameter.USER, username);
>>>> properties.put(SessionParameter.PASSWORD, password);
>>>>
>>>> Authenticator.setDefault(new BasicAuthenticator(username, password));
>>>>
>>>> return properties;
>>>> }
>>>>
>>>> static class BasicAuthenticator extends Authenticator
>>>> {
>>>> private PasswordAuthentication passwordAuthentication;
>>>>
>>>> public BasicAuthenticator(String user, String password)
>>>> {
>>>> passwordAuthentication = new PasswordAuthentication(user,
>>>> password.toCharArray());
>>>> }
>>>>
>>>> @Override
>>>> protected synchronized PasswordAuthentication
>>>> getPasswordAuthentication()
>>>> {
>>>> return passwordAuthentication;
>>>> }
>>>> }
>>>> }
>>>>
>>>> and this standalone succeeds
>>>>
>>>> import java.net.Authenticator;
>>>> import java.net.PasswordAuthentication;
>>>> import java.util.HashMap;
>>>> import java.util.List;
>>>> import java.util.Map;
>>>>
>>>> import org.apache.chemistry.opencmis.client.api.Folder;
>>>> import org.apache.chemistry.opencmis.client.api.Repository;
>>>> import org.apache.chemistry.opencmis.client.api.Session;
>>>> import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
>>>> import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
>>>> import org.apache.chemistry.opencmis.commons.SessionParameter;
>>>> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>>>>
>>>>
>>>> public class Al {
>>>>
>>>> public static void main(String[] args) {
>>>>
>>>> Map<String, String> props = getProps();
>>>>
>>>> List<Repository> repositories =
>>>> SessionFactoryImpl.newInstance().getRepositories(props);
>>>>
>>>> Repository repository = null;
>>>> for (Repository rep : repositories) {
>>>> if (rep.getName().equalsIgnoreCase("Main Repository")) {
>>>> repository = rep;
>>>> break;
>>>> }
>>>> }
>>>>
>>>> if (repository != null) {
>>>> Session session = repository.createSession();
>>>>
>>>> Folder f = session.getRootFolder();
>>>> System.out.println(f.getName());
>>>> }
>>>> }
>>>>
>>>> private static Map<String, String> getProps() {
>>>> String wsdl =
>>>> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>>>>
>>>> Map<String, String> properties = new HashMap<String, String>();
>>>> properties.put(SessionParameter.BINDING_TYPE,
>>>> BindingType.WEBSERVICES.value());
>>>> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, wsdl);
>>>>
>>>> String username = "xxx";
>>>> String password = "yyy";
>>>>
>>>> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
>>>> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>>>>
>>>> properties.put(SessionParameter.USER, username);
>>>> properties.put(SessionParameter.PASSWORD, password);
>>>>
>>>> Authenticator.setDefault(new BasicAuthenticator(username, password));
>>>>
>>>> return properties;
>>>> }
>>>>
>>>> }
>>>>
>>>> class BasicAuthenticator extends Authenticator
>>>> {
>>>> private PasswordAuthentication passwordAuthentication;
>>>>
>>>> public BasicAuthenticator(String user, String password)
>>>> {
>>>> passwordAuthentication = new PasswordAuthentication(user,
>>>> password.toCharArray());
>>>> }
>>>>
>>>> @Override
>>>> protected synchronized PasswordAuthentication getPasswordAuthentication()
>>>> {
>>>> return passwordAuthentication;
>>>> }
>>>> }
>>>>
>>>>
>>>> i even added <prefer-application-packages> like the following to try
>>>> to use my copies of the jars in weblogic-application.xml
>>>>
>>>> <prefer-application-packages>
>>>> <package-name>org.apache.chemistry.*</package-name>
>>>> <package-name>com.glassfish.gmbal.*</package-name>
>>>> <package-name>com.sun.istack.*</package-name>
>>>> <package-name>com.sun.xml.stream.*</package-name>
>>>> <package-name>com.sun.xml.ws.*</package-name>
>>>> <package-name>com.sun.xml.bind.*</package-name>
>>>> <package-name>com.sun.xml.txw2.*</package-name>
>>>> <package-name>org.jvnet.*</package-name>
>>>> <package-name>javax.xml.bind.*</package-name>
>>>> <package-name>javax.xml.ws.*</package-name>
>>>> </prefer-application-packages>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ---
>>>> <br type="_moz" />
>>>>
>>>> On 2014-02-20 14:10, Dave Brosius wrote:
>>>>> I'm using
>>>>>
>>>>> Alfresco Community v4.0.0
>>>>> (4003) schema 5025
>>>>>
>>>>> The web service url is
>>>>>
>>>>> http://some.local.host.com:9080/alfresco/cmisws/RepositoryService?wsdl
>>>>>
>>>>>
>>>>> I decided to build a standalone app that just tested that one thing,
>>>>> so it would be easier to test (the real thing is part of a web app on
>>>>> weblogic)
>>>>>
>>>>> It works fine in the standalone app. I'm now thinking that it's a
>>>>> quiet jar conflict, as i had to download a bunch of jars that
>>>>> apparently
>>>>> wls was providing.
>>>>>
>>>>> I'm going to stuff all the jars i downloaded into WEB-INF/lib and see
>>>>> what happens.
>>>>>
>>>>> ---
>>>>> <br type="_moz" />
>>>>>
>>>>> On 2014-02-20 11:56, Florian Müller wrote:
>>>>>> Hi Dave,
>>>>>>
>>>>>> Looks like the transferred XML is somehow corrupt. All properties
>>>>>> became extensions.
>>>>>> Would it be possible to capture the response from the Alfresco server?
>>>>>> Which Alfresco version are you connection to and which Alfresco CMIS
>>>>>> URL did you use?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Florian
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Greetings,
>>>>>>>
>>>>>>> I am running into a NPE trying to get the root folder from an
>>>>>>> Alfresco cmis thru chemistry 0.10.0.
>>>>>>>
>>>>>>> I'm assuming that there is some sort of configuration missing on my
>>>>>>> part, but i'm not sure how to debug further.
>>>>>>>
>>>>>>> Basically, when calling Session.getRootFolder it gets to
>>>>>>>
>>>>>>> SessionImpl getObject(ObjectId objectId, OperationContext context);
>>>>>>>
>>>>>>> where it fetches ObjectData, that looks like this:
>>>>>>>
>>>>>>> Object Data [properties=Properties Data
>>>>>>>
>>>>>>> [properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=cmis:allowedChildObjectTypeIds}: ,
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=cmis:objectTypeId}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> cmis:folder],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {null=cmis:path}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: /],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {null=cmis:name}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>>>>>> Home],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>>>>> {null=cmis:creationDate}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> 2013-11-18T19:22:26.382+05:30],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {null=cmis:changeToken}: ,
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {null=cmis:lastModifiedBy}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {null=cmis:createdBy}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=cmis:objectId}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=cmis:baseTypeId}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> cmis:folder],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=alfcmis:nodeRef}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>>>>> {null=cmis:lastModificationDate}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> 2013-11-18T19:44:23.898+05:30],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}:
>>>>>>> [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets,
>>>>>>> {http://www.alfresco.org}properties {}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {propertyDefinitionId=app:icon}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> space-icon-default],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {propertyDefinitionId=cm:description}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: The
>>>>>>> company root space],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {propertyDefinitionId=cmis:policyText}: ,
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {propertyDefinitionId=cm:title}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>>>>>> Home]], {http://www.alfresco.org}appliedAspects {}: P:cm:titled,
>>>>>>> {http://www.alfresco.org}appliedAspects {}: P:sys:localized]]],
>>>>>>> allowable
>>>>>>> actions=Allowable Actions [allowable actions=[CAN_UPDATE_PROPERTIES,
>>>>>>> CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES, CAN_GET_OBJECT_RELATIONSHIPS,
>>>>>>> CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES, CAN_GET_CHILDREN,
>>>>>>> CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER, CAN_CREATE_RELATIONSHIP,
>>>>>>> CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event info=null,
>>>>>>> ACL=null, is exact ACL=null, policy ids=null, relationships=[],
>>>>>>> renditions=[]][extensions=null]
>>>>>>>
>>>>>>> It then switches on the objectData's baseTypeId
>>>>>>>
>>>>>>> which uses the entry in the properties.properties object as
>>>>>>>
>>>>>>> PropertyData<?> property =
>>>>>>> properties.getProperties().get("cmis:baseTypeId");
>>>>>>>
>>>>>>> but as you can see above the properties.properties collection is empty.
>>>>>>>
>>>>>>> since the value returned is null, the switch NPEs on me.
>>>>>>>
>>>>>>> So i'm not sure why the properties.properties collection is empty.
>>>>>>>
>>>>>>> Any help would be greatly appreciated.
>>>>>>>
>>>>>>> dave
Re: NPE trying to session.getRootFolder
Posted by Florian Müller <fm...@apache.org>.
Hi Dave,
The default configuration assumes JAX-WS RI 2.1.7 and requires a few
extra jars.
Set the following parameter to switch to the JAX-WS implementation that
is part of the JRE (2.2.x):
properties.put(SessionParameter.WEBSERVICES_JAXWS_IMPL, "sunjre");
- Florian
>
>
> In jaxws-rt-2.2.6-6.jar, the code
>
> com.sun.xml.ws.api.client.ServiceInterceptorFactory.java
>
> method
>
> public static @NotNull ServiceInterceptor load(@NotNull WSService
> service, @Nullable ClassLoader cl) {
> List<ServiceInterceptor> l = new ArrayList<ServiceInterceptor>();
>
> // first service look-up
> for( ServiceInterceptorFactory f :
> ServiceFinder.find(ServiceInterceptorFactory.class))
> l.add(f.create(service));
>
> // then thread-local
> for( ServiceInterceptorFactory f : threadLocalFactories.get())
> l.add(f.create(service));
>
> return ServiceInterceptor.aggregate(l.toArray(new
> ServiceInterceptor[l.size()]));
> }
>
> SHOULD PROBABLY BE
>
> public static @NotNull ServiceInterceptor load(@NotNull WSService
> service, @Nullable ClassLoader cl) {
> List<ServiceInterceptor> l = new ArrayList<ServiceInterceptor>();
>
> // first service look-up
> for( Object f : ServiceFinder.find(ServiceInterceptorFactory.class)) {
> if (f instanceof ServiceInterceptorFactory)
> l.add(f.create(service));
> }
>
> // then thread-local
> for( ServiceInterceptorFactory f : threadLocalFactories.get())
> l.add(f.create(service));
>
> return ServiceInterceptor.aggregate(l.toArray(new
> ServiceInterceptor[l.size()]));
> }
>
> ---
> <br type="_moz" />
>
> On 2014-02-21 11:41, Dave Brosius wrote:
>> Caused by: java.lang.ClassCastException: Cannot cast
>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
>> com.sun.xml.ws.api.client.ServiceInterceptorFactory
>> at java.lang.Class.cast(Class.java:3094)
>> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:460)
>> at
>> com.sun.xml.ws.util.ServiceFinder$CompositeIterator.next(ServiceFinder.java:402)
>> at
>> com.sun.xml.ws.api.client.ServiceInterceptorFactory.load(ServiceInterceptorFactory.java:84)
>> at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:245)
>> at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:205)
>> at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:195)
>> at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:112)
>> at javax.xml.ws.Service.<init>(Service.java:92)
>> at
>> org.apache.chemistry.opencmis.commons.impl.jaxb.RepositoryService.<init>(RepositoryService.java:46)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>> at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>> at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider$CmisServiceHolder.createServiceObject(AbstractPortProvider.java:200)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider$CmisServiceHolder.<init>(AbstractPortProvider.java:187)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.initServiceObject(AbstractPortProvider.java:514)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getPortObject(AbstractPortProvider.java:454)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getRepositoryServicePort(AbstractPortProvider.java:280)
>> at
>> org.apache.chemistry.opencmis.client.bindings.spi.webservices.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:69)
>> at
>> org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:85)
>> at
>> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:109)
>> at
>> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:96)
>>
>>
>>
>> com.sun.xml.ws.api.client.ServiceInterceptorFactory: Provider
>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory is specified in
>> jar:file:/home/dave/Oracle/Middleware/Oracle_Home/oracle_common/modules/com.oracle.webservices.wls.wls-ws-metainf-services_2.0.0.0.jar!/META-INF/services/com.sun.xml.ws.api.client.ServiceInterceptorFactorybut could not be instantiated: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to com.sun.xml.ws.api.client.ServiceInterceptorFactory
>>
>>
>>
>>
>> ---
>> <br type="_moz" />
>>
>> On 2014-02-21 11:32, Dave Brosius wrote:
>>> I've added more to paths to my <prefer-application-packages> in my ear
>>>
>>>
>>> and now i get
>>>
>>> Caused by: java.lang.ClassCastException: Cannot cast
>>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
>>> com.sun.xml.ws.api.client.ServiceInterceptorFactory
>>>
>>> Now this SPI is found in jaxws-rt-2.2.26-6.jar and is
>>> javax.xml.ws.spi.Provider=com.sun.xml.ws.spi.ProviderImpl there
>>>
>>> and i have
>>>
>>> <prefer-application-packages>
>>> <package-name>javax.xml.ws.*</package-name>
>>> ....
>>>
>>>
>>> in my weblogic-application.xml in my ear, so it should be using that
>>> jar. But yet it is still picking up WLSServiceInterceptorFactory thru
>>> spi somehow.
>>>
>>> Anyone know what my problem is?
>>>
>>>
>>> ---
>>> <br type="_moz" />
>>>
>>> On 2014-02-20 17:08, Dave Brosius wrote:
>>>> It must be a classloader issue with some jar in wls, as this web app fails
>>>>
>>>> package com.suckage;
>>>>
>>>> import java.io.IOException;
>>>> import java.net.Authenticator;
>>>> import java.net.PasswordAuthentication;
>>>> import java.util.HashMap;
>>>> import java.util.List;
>>>> import java.util.Map;
>>>>
>>>> import javax.servlet.ServletException;
>>>> import javax.servlet.http.HttpServlet;
>>>> import javax.servlet.http.HttpServletRequest;
>>>> import javax.servlet.http.HttpServletResponse;
>>>>
>>>> import org.apache.chemistry.opencmis.client.api.Folder;
>>>> import org.apache.chemistry.opencmis.client.api.Repository;
>>>> import org.apache.chemistry.opencmis.client.api.Session;
>>>> import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
>>>> import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
>>>> import org.apache.chemistry.opencmis.commons.SessionParameter;
>>>> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>>>>
>>>> public class CmisServlet extends HttpServlet {
>>>>
>>>> private Repository repository = null;
>>>> private Session session = null;
>>>>
>>>> @Override
>>>> public void init() throws ServletException {
>>>> super.init();
>>>>
>>>> List<Repository> repositories =
>>>> SessionFactoryImpl.newInstance().getRepositories(getProps());
>>>>
>>>> for (Repository rep : repositories) {
>>>> if (rep.getName().equalsIgnoreCase("Main Repository")) {
>>>> repository = rep;
>>>> break;
>>>> }
>>>> }
>>>>
>>>> session = repository.createSession();
>>>> }
>>>>
>>>> @Override
>>>> protected void doGet(HttpServletRequest request,
>>>> HttpServletResponse response)
>>>> throws ServletException, IOException {
>>>>
>>>> if (session != null) {
>>>> Folder f = session.getRootFolder();
>>>>
>>>> response.setStatus(HttpServletResponse.SC_OK);
>>>> response.getOutputStream().write(f.getName().getBytes("UTF-8"));
>>>> }
>>>> }
>>>>
>>>> private static Map<String, String> getProps() {
>>>> String wsdl =
>>>> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>>>>
>>>> Map<String, String> properties = new HashMap<String, String>();
>>>> properties.put(SessionParameter.BINDING_TYPE,
>>>> BindingType.WEBSERVICES.value());
>>>> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, wsdl);
>>>>
>>>> String username = "xxx";
>>>> String password = "yyy";
>>>>
>>>> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
>>>> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>>>>
>>>> properties.put(SessionParameter.USER, username);
>>>> properties.put(SessionParameter.PASSWORD, password);
>>>>
>>>> Authenticator.setDefault(new BasicAuthenticator(username, password));
>>>>
>>>> return properties;
>>>> }
>>>>
>>>> static class BasicAuthenticator extends Authenticator
>>>> {
>>>> private PasswordAuthentication passwordAuthentication;
>>>>
>>>> public BasicAuthenticator(String user, String password)
>>>> {
>>>> passwordAuthentication = new PasswordAuthentication(user,
>>>> password.toCharArray());
>>>> }
>>>>
>>>> @Override
>>>> protected synchronized PasswordAuthentication
>>>> getPasswordAuthentication()
>>>> {
>>>> return passwordAuthentication;
>>>> }
>>>> }
>>>> }
>>>>
>>>> and this standalone succeeds
>>>>
>>>> import java.net.Authenticator;
>>>> import java.net.PasswordAuthentication;
>>>> import java.util.HashMap;
>>>> import java.util.List;
>>>> import java.util.Map;
>>>>
>>>> import org.apache.chemistry.opencmis.client.api.Folder;
>>>> import org.apache.chemistry.opencmis.client.api.Repository;
>>>> import org.apache.chemistry.opencmis.client.api.Session;
>>>> import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
>>>> import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
>>>> import org.apache.chemistry.opencmis.commons.SessionParameter;
>>>> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>>>>
>>>>
>>>> public class Al {
>>>>
>>>> public static void main(String[] args) {
>>>>
>>>> Map<String, String> props = getProps();
>>>>
>>>> List<Repository> repositories =
>>>> SessionFactoryImpl.newInstance().getRepositories(props);
>>>>
>>>> Repository repository = null;
>>>> for (Repository rep : repositories) {
>>>> if (rep.getName().equalsIgnoreCase("Main Repository")) {
>>>> repository = rep;
>>>> break;
>>>> }
>>>> }
>>>>
>>>> if (repository != null) {
>>>> Session session = repository.createSession();
>>>>
>>>> Folder f = session.getRootFolder();
>>>> System.out.println(f.getName());
>>>> }
>>>> }
>>>>
>>>> private static Map<String, String> getProps() {
>>>> String wsdl =
>>>> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>>>>
>>>> Map<String, String> properties = new HashMap<String, String>();
>>>> properties.put(SessionParameter.BINDING_TYPE,
>>>> BindingType.WEBSERVICES.value());
>>>> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, wsdl);
>>>> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, wsdl);
>>>>
>>>> String username = "xxx";
>>>> String password = "yyy";
>>>>
>>>> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
>>>> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>>>>
>>>> properties.put(SessionParameter.USER, username);
>>>> properties.put(SessionParameter.PASSWORD, password);
>>>>
>>>> Authenticator.setDefault(new BasicAuthenticator(username, password));
>>>>
>>>> return properties;
>>>> }
>>>>
>>>> }
>>>>
>>>> class BasicAuthenticator extends Authenticator
>>>> {
>>>> private PasswordAuthentication passwordAuthentication;
>>>>
>>>> public BasicAuthenticator(String user, String password)
>>>> {
>>>> passwordAuthentication = new PasswordAuthentication(user,
>>>> password.toCharArray());
>>>> }
>>>>
>>>> @Override
>>>> protected synchronized PasswordAuthentication getPasswordAuthentication()
>>>> {
>>>> return passwordAuthentication;
>>>> }
>>>> }
>>>>
>>>>
>>>> i even added <prefer-application-packages> like the following to try
>>>> to use my copies of the jars in weblogic-application.xml
>>>>
>>>> <prefer-application-packages>
>>>> <package-name>org.apache.chemistry.*</package-name>
>>>> <package-name>com.glassfish.gmbal.*</package-name>
>>>> <package-name>com.sun.istack.*</package-name>
>>>> <package-name>com.sun.xml.stream.*</package-name>
>>>> <package-name>com.sun.xml.ws.*</package-name>
>>>> <package-name>com.sun.xml.bind.*</package-name>
>>>> <package-name>com.sun.xml.txw2.*</package-name>
>>>> <package-name>org.jvnet.*</package-name>
>>>> <package-name>javax.xml.bind.*</package-name>
>>>> <package-name>javax.xml.ws.*</package-name>
>>>> </prefer-application-packages>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ---
>>>> <br type="_moz" />
>>>>
>>>> On 2014-02-20 14:10, Dave Brosius wrote:
>>>>> I'm using
>>>>>
>>>>> Alfresco Community v4.0.0
>>>>> (4003) schema 5025
>>>>>
>>>>> The web service url is
>>>>>
>>>>> http://some.local.host.com:9080/alfresco/cmisws/RepositoryService?wsdl
>>>>>
>>>>>
>>>>> I decided to build a standalone app that just tested that one thing,
>>>>> so it would be easier to test (the real thing is part of a web app on
>>>>> weblogic)
>>>>>
>>>>> It works fine in the standalone app. I'm now thinking that it's a
>>>>> quiet jar conflict, as i had to download a bunch of jars that
>>>>> apparently
>>>>> wls was providing.
>>>>>
>>>>> I'm going to stuff all the jars i downloaded into WEB-INF/lib and see
>>>>> what happens.
>>>>>
>>>>> ---
>>>>> <br type="_moz" />
>>>>>
>>>>> On 2014-02-20 11:56, Florian Müller wrote:
>>>>>> Hi Dave,
>>>>>>
>>>>>> Looks like the transferred XML is somehow corrupt. All properties
>>>>>> became extensions.
>>>>>> Would it be possible to capture the response from the Alfresco server?
>>>>>> Which Alfresco version are you connection to and which Alfresco CMIS
>>>>>> URL did you use?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Florian
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Greetings,
>>>>>>>
>>>>>>> I am running into a NPE trying to get the root folder from an
>>>>>>> Alfresco cmis thru chemistry 0.10.0.
>>>>>>>
>>>>>>> I'm assuming that there is some sort of configuration missing on my
>>>>>>> part, but i'm not sure how to debug further.
>>>>>>>
>>>>>>> Basically, when calling Session.getRootFolder it gets to
>>>>>>>
>>>>>>> SessionImpl getObject(ObjectId objectId, OperationContext context);
>>>>>>>
>>>>>>> where it fetches ObjectData, that looks like this:
>>>>>>>
>>>>>>> Object Data [properties=Properties Data
>>>>>>>
>>>>>>> [properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=cmis:allowedChildObjectTypeIds}: ,
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=cmis:objectTypeId}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> cmis:folder],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {null=cmis:path}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: /],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {null=cmis:name}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>>>>>> Home],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>>>>> {null=cmis:creationDate}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> 2013-11-18T19:22:26.382+05:30],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {null=cmis:changeToken}: ,
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {null=cmis:lastModifiedBy}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {null=cmis:createdBy}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=cmis:objectId}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=cmis:baseTypeId}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> cmis:folder],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=alfcmis:nodeRef}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>>>>> {null=cmis:lastModificationDate}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> 2013-11-18T19:44:23.898+05:30],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>>> {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}:
>>>>>>> [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets,
>>>>>>> {http://www.alfresco.org}properties {}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {propertyDefinitionId=app:icon}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>>> space-icon-default],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {propertyDefinitionId=cm:description}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: The
>>>>>>> company root space],
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {propertyDefinitionId=cmis:policyText}: ,
>>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>>> {propertyDefinitionId=cm:title}:
>>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>>>>>> Home]], {http://www.alfresco.org}appliedAspects {}: P:cm:titled,
>>>>>>> {http://www.alfresco.org}appliedAspects {}: P:sys:localized]]],
>>>>>>> allowable
>>>>>>> actions=Allowable Actions [allowable actions=[CAN_UPDATE_PROPERTIES,
>>>>>>> CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES, CAN_GET_OBJECT_RELATIONSHIPS,
>>>>>>> CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES, CAN_GET_CHILDREN,
>>>>>>> CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER, CAN_CREATE_RELATIONSHIP,
>>>>>>> CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event info=null,
>>>>>>> ACL=null, is exact ACL=null, policy ids=null, relationships=[],
>>>>>>> renditions=[]][extensions=null]
>>>>>>>
>>>>>>> It then switches on the objectData's baseTypeId
>>>>>>>
>>>>>>> which uses the entry in the properties.properties object as
>>>>>>>
>>>>>>> PropertyData<?> property =
>>>>>>> properties.getProperties().get("cmis:baseTypeId");
>>>>>>>
>>>>>>> but as you can see above the properties.properties collection is empty.
>>>>>>>
>>>>>>> since the value returned is null, the switch NPEs on me.
>>>>>>>
>>>>>>> So i'm not sure why the properties.properties collection is empty.
>>>>>>>
>>>>>>> Any help would be greatly appreciated.
>>>>>>>
>>>>>>> dave
>
Re: NPE trying to session.getRootFolder
Posted by Dave Brosius <db...@mebigfatguy.com>.
In jaxws-rt-2.2.6-6.jar, the code
com.sun.xml.ws.api.client.ServiceInterceptorFactory.java
method
public static @NotNull ServiceInterceptor load(@NotNull WSService
service, @Nullable ClassLoader cl) {
List<ServiceInterceptor> l = new ArrayList<ServiceInterceptor>();
// first service look-up
for( ServiceInterceptorFactory f :
ServiceFinder.find(ServiceInterceptorFactory.class))
l.add(f.create(service));
// then thread-local
for( ServiceInterceptorFactory f : threadLocalFactories.get())
l.add(f.create(service));
return ServiceInterceptor.aggregate(l.toArray(new
ServiceInterceptor[l.size()]));
}
SHOULD PROBABLY BE
public static @NotNull ServiceInterceptor load(@NotNull WSService
service, @Nullable ClassLoader cl) {
List<ServiceInterceptor> l = new ArrayList<ServiceInterceptor>();
// first service look-up
for( Object f : ServiceFinder.find(ServiceInterceptorFactory.class)) {
if (f instanceof ServiceInterceptorFactory)
l.add(f.create(service));
}
// then thread-local
for( ServiceInterceptorFactory f : threadLocalFactories.get())
l.add(f.create(service));
return ServiceInterceptor.aggregate(l.toArray(new
ServiceInterceptor[l.size()]));
}
---
<br type="_moz" />
On 2014-02-21 11:41, Dave Brosius wrote:
> Caused by: java.lang.ClassCastException: Cannot cast
> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
> com.sun.xml.ws.api.client.ServiceInterceptorFactory
> at java.lang.Class.cast(Class.java:3094)
> at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:460)
> at
> com.sun.xml.ws.util.ServiceFinder$CompositeIterator.next(ServiceFinder.java:402)
> at
> com.sun.xml.ws.api.client.ServiceInterceptorFactory.load(ServiceInterceptorFactory.java:84)
> at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:245)
> at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:205)
> at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:195)
> at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:112)
> at javax.xml.ws.Service.<init>(Service.java:92)
> at
> org.apache.chemistry.opencmis.commons.impl.jaxb.RepositoryService.<init>(RepositoryService.java:46)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider$CmisServiceHolder.createServiceObject(AbstractPortProvider.java:200)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider$CmisServiceHolder.<init>(AbstractPortProvider.java:187)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.initServiceObject(AbstractPortProvider.java:514)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getPortObject(AbstractPortProvider.java:454)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getRepositoryServicePort(AbstractPortProvider.java:280)
> at
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:69)
> at
> org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:85)
> at
> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:109)
> at
> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:96)
>
>
>
> com.sun.xml.ws.api.client.ServiceInterceptorFactory: Provider
> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory is specified in
> jar:file:/home/dave/Oracle/Middleware/Oracle_Home/oracle_common/modules/com.oracle.webservices.wls.wls-ws-metainf-services_2.0.0.0.jar!/META-INF/services/com.sun.xml.ws.api.client.ServiceInterceptorFactorybut could not be instantiated: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to com.sun.xml.ws.api.client.ServiceInterceptorFactory
>
>
>
>
> ---
> <br type="_moz" />
>
> On 2014-02-21 11:32, Dave Brosius wrote:
>> I've added more to paths to my <prefer-application-packages> in my ear
>>
>>
>> and now i get
>>
>> Caused by: java.lang.ClassCastException: Cannot cast
>> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
>> com.sun.xml.ws.api.client.ServiceInterceptorFactory
>>
>> Now this SPI is found in jaxws-rt-2.2.26-6.jar and is
>> javax.xml.ws.spi.Provider=com.sun.xml.ws.spi.ProviderImpl there
>>
>> and i have
>>
>> <prefer-application-packages>
>> <package-name>javax.xml.ws.*</package-name>
>> ....
>>
>>
>> in my weblogic-application.xml in my ear, so it should be using that
>> jar. But yet it is still picking up WLSServiceInterceptorFactory thru
>> spi somehow.
>>
>> Anyone know what my problem is?
>>
>>
>> ---
>> <br type="_moz" />
>>
>> On 2014-02-20 17:08, Dave Brosius wrote:
>>> It must be a classloader issue with some jar in wls, as this web app fails
>>>
>>> package com.suckage;
>>>
>>> import java.io.IOException;
>>> import java.net.Authenticator;
>>> import java.net.PasswordAuthentication;
>>> import java.util.HashMap;
>>> import java.util.List;
>>> import java.util.Map;
>>>
>>> import javax.servlet.ServletException;
>>> import javax.servlet.http.HttpServlet;
>>> import javax.servlet.http.HttpServletRequest;
>>> import javax.servlet.http.HttpServletResponse;
>>>
>>> import org.apache.chemistry.opencmis.client.api.Folder;
>>> import org.apache.chemistry.opencmis.client.api.Repository;
>>> import org.apache.chemistry.opencmis.client.api.Session;
>>> import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
>>> import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
>>> import org.apache.chemistry.opencmis.commons.SessionParameter;
>>> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>>>
>>> public class CmisServlet extends HttpServlet {
>>>
>>> private Repository repository = null;
>>> private Session session = null;
>>>
>>> @Override
>>> public void init() throws ServletException {
>>> super.init();
>>>
>>> List<Repository> repositories =
>>> SessionFactoryImpl.newInstance().getRepositories(getProps());
>>>
>>> for (Repository rep : repositories) {
>>> if (rep.getName().equalsIgnoreCase("Main Repository")) {
>>> repository = rep;
>>> break;
>>> }
>>> }
>>>
>>> session = repository.createSession();
>>> }
>>>
>>> @Override
>>> protected void doGet(HttpServletRequest request,
>>> HttpServletResponse response)
>>> throws ServletException, IOException {
>>>
>>> if (session != null) {
>>> Folder f = session.getRootFolder();
>>>
>>> response.setStatus(HttpServletResponse.SC_OK);
>>> response.getOutputStream().write(f.getName().getBytes("UTF-8"));
>>> }
>>> }
>>>
>>> private static Map<String, String> getProps() {
>>> String wsdl =
>>> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>>>
>>> Map<String, String> properties = new HashMap<String, String>();
>>> properties.put(SessionParameter.BINDING_TYPE,
>>> BindingType.WEBSERVICES.value());
>>> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, wsdl);
>>>
>>> String username = "xxx";
>>> String password = "yyy";
>>>
>>> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
>>> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>>>
>>> properties.put(SessionParameter.USER, username);
>>> properties.put(SessionParameter.PASSWORD, password);
>>>
>>> Authenticator.setDefault(new BasicAuthenticator(username, password));
>>>
>>> return properties;
>>> }
>>>
>>> static class BasicAuthenticator extends Authenticator
>>> {
>>> private PasswordAuthentication passwordAuthentication;
>>>
>>> public BasicAuthenticator(String user, String password)
>>> {
>>> passwordAuthentication = new PasswordAuthentication(user,
>>> password.toCharArray());
>>> }
>>>
>>> @Override
>>> protected synchronized PasswordAuthentication
>>> getPasswordAuthentication()
>>> {
>>> return passwordAuthentication;
>>> }
>>> }
>>> }
>>>
>>> and this standalone succeeds
>>>
>>> import java.net.Authenticator;
>>> import java.net.PasswordAuthentication;
>>> import java.util.HashMap;
>>> import java.util.List;
>>> import java.util.Map;
>>>
>>> import org.apache.chemistry.opencmis.client.api.Folder;
>>> import org.apache.chemistry.opencmis.client.api.Repository;
>>> import org.apache.chemistry.opencmis.client.api.Session;
>>> import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
>>> import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
>>> import org.apache.chemistry.opencmis.commons.SessionParameter;
>>> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>>>
>>>
>>> public class Al {
>>>
>>> public static void main(String[] args) {
>>>
>>> Map<String, String> props = getProps();
>>>
>>> List<Repository> repositories =
>>> SessionFactoryImpl.newInstance().getRepositories(props);
>>>
>>> Repository repository = null;
>>> for (Repository rep : repositories) {
>>> if (rep.getName().equalsIgnoreCase("Main Repository")) {
>>> repository = rep;
>>> break;
>>> }
>>> }
>>>
>>> if (repository != null) {
>>> Session session = repository.createSession();
>>>
>>> Folder f = session.getRootFolder();
>>> System.out.println(f.getName());
>>> }
>>> }
>>>
>>> private static Map<String, String> getProps() {
>>> String wsdl =
>>> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>>>
>>> Map<String, String> properties = new HashMap<String, String>();
>>> properties.put(SessionParameter.BINDING_TYPE,
>>> BindingType.WEBSERVICES.value());
>>> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, wsdl);
>>> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, wsdl);
>>>
>>> String username = "xxx";
>>> String password = "yyy";
>>>
>>> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
>>> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>>>
>>> properties.put(SessionParameter.USER, username);
>>> properties.put(SessionParameter.PASSWORD, password);
>>>
>>> Authenticator.setDefault(new BasicAuthenticator(username, password));
>>>
>>> return properties;
>>> }
>>>
>>> }
>>>
>>> class BasicAuthenticator extends Authenticator
>>> {
>>> private PasswordAuthentication passwordAuthentication;
>>>
>>> public BasicAuthenticator(String user, String password)
>>> {
>>> passwordAuthentication = new PasswordAuthentication(user,
>>> password.toCharArray());
>>> }
>>>
>>> @Override
>>> protected synchronized PasswordAuthentication getPasswordAuthentication()
>>> {
>>> return passwordAuthentication;
>>> }
>>> }
>>>
>>>
>>> i even added <prefer-application-packages> like the following to try
>>> to use my copies of the jars in weblogic-application.xml
>>>
>>> <prefer-application-packages>
>>> <package-name>org.apache.chemistry.*</package-name>
>>> <package-name>com.glassfish.gmbal.*</package-name>
>>> <package-name>com.sun.istack.*</package-name>
>>> <package-name>com.sun.xml.stream.*</package-name>
>>> <package-name>com.sun.xml.ws.*</package-name>
>>> <package-name>com.sun.xml.bind.*</package-name>
>>> <package-name>com.sun.xml.txw2.*</package-name>
>>> <package-name>org.jvnet.*</package-name>
>>> <package-name>javax.xml.bind.*</package-name>
>>> <package-name>javax.xml.ws.*</package-name>
>>> </prefer-application-packages>
>>>
>>>
>>>
>>>
>>>
>>> ---
>>> <br type="_moz" />
>>>
>>> On 2014-02-20 14:10, Dave Brosius wrote:
>>>> I'm using
>>>>
>>>> Alfresco Community v4.0.0
>>>> (4003) schema 5025
>>>>
>>>> The web service url is
>>>>
>>>> http://some.local.host.com:9080/alfresco/cmisws/RepositoryService?wsdl
>>>>
>>>>
>>>> I decided to build a standalone app that just tested that one thing,
>>>> so it would be easier to test (the real thing is part of a web app on
>>>> weblogic)
>>>>
>>>> It works fine in the standalone app. I'm now thinking that it's a
>>>> quiet jar conflict, as i had to download a bunch of jars that
>>>> apparently
>>>> wls was providing.
>>>>
>>>> I'm going to stuff all the jars i downloaded into WEB-INF/lib and see
>>>> what happens.
>>>>
>>>> ---
>>>> <br type="_moz" />
>>>>
>>>> On 2014-02-20 11:56, Florian Müller wrote:
>>>>> Hi Dave,
>>>>>
>>>>> Looks like the transferred XML is somehow corrupt. All properties
>>>>> became extensions.
>>>>> Would it be possible to capture the response from the Alfresco server?
>>>>> Which Alfresco version are you connection to and which Alfresco CMIS
>>>>> URL did you use?
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Florian
>>>>>
>>>>>
>>>>>
>>>>>> Greetings,
>>>>>>
>>>>>> I am running into a NPE trying to get the root folder from an
>>>>>> Alfresco cmis thru chemistry 0.10.0.
>>>>>>
>>>>>> I'm assuming that there is some sort of configuration missing on my
>>>>>> part, but i'm not sure how to debug further.
>>>>>>
>>>>>> Basically, when calling Session.getRootFolder it gets to
>>>>>>
>>>>>> SessionImpl getObject(ObjectId objectId, OperationContext context);
>>>>>>
>>>>>> where it fetches ObjectData, that looks like this:
>>>>>>
>>>>>> Object Data [properties=Properties Data
>>>>>>
>>>>>> [properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>> {null=cmis:allowedChildObjectTypeIds}: ,
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>> {null=cmis:objectTypeId}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>> cmis:folder],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>> {null=cmis:path}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: /],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>> {null=cmis:name}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>>>>> Home],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>>>> {null=cmis:creationDate}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>> 2013-11-18T19:22:26.382+05:30],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>> {null=cmis:changeToken}: ,
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>> {null=cmis:lastModifiedBy}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>> {null=cmis:createdBy}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>> {null=cmis:objectId}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>> {null=cmis:baseTypeId}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>> cmis:folder],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>> {null=alfcmis:nodeRef}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>>>> {null=cmis:lastModificationDate}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>> 2013-11-18T19:44:23.898+05:30],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>>> {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}:
>>>>>> [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets,
>>>>>> {http://www.alfresco.org}properties {}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>> {propertyDefinitionId=app:icon}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>>> space-icon-default],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>> {propertyDefinitionId=cm:description}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: The
>>>>>> company root space],
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>> {propertyDefinitionId=cmis:policyText}: ,
>>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>>> {propertyDefinitionId=cm:title}:
>>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>>>>> Home]], {http://www.alfresco.org}appliedAspects {}: P:cm:titled,
>>>>>> {http://www.alfresco.org}appliedAspects {}: P:sys:localized]]],
>>>>>> allowable
>>>>>> actions=Allowable Actions [allowable actions=[CAN_UPDATE_PROPERTIES,
>>>>>> CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES, CAN_GET_OBJECT_RELATIONSHIPS,
>>>>>> CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES, CAN_GET_CHILDREN,
>>>>>> CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER, CAN_CREATE_RELATIONSHIP,
>>>>>> CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event info=null,
>>>>>> ACL=null, is exact ACL=null, policy ids=null, relationships=[],
>>>>>> renditions=[]][extensions=null]
>>>>>>
>>>>>> It then switches on the objectData's baseTypeId
>>>>>>
>>>>>> which uses the entry in the properties.properties object as
>>>>>>
>>>>>> PropertyData<?> property =
>>>>>> properties.getProperties().get("cmis:baseTypeId");
>>>>>>
>>>>>> but as you can see above the properties.properties collection is empty.
>>>>>>
>>>>>> since the value returned is null, the switch NPEs on me.
>>>>>>
>>>>>> So i'm not sure why the properties.properties collection is empty.
>>>>>>
>>>>>> Any help would be greatly appreciated.
>>>>>>
>>>>>> dave
Re: NPE trying to session.getRootFolder
Posted by Dave Brosius <db...@mebigfatguy.com>.
Caused by: java.lang.ClassCastException: Cannot cast
weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
com.sun.xml.ws.api.client.ServiceInterceptorFactory
at java.lang.Class.cast(Class.java:3094)
at
com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:460)
at
com.sun.xml.ws.util.ServiceFinder$CompositeIterator.next(ServiceFinder.java:402)
at
com.sun.xml.ws.api.client.ServiceInterceptorFactory.load(ServiceInterceptorFactory.java:84)
at
com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:245)
at
com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:205)
at
com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:195)
at
com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:112)
at javax.xml.ws.Service.<init>(Service.java:92)
at
org.apache.chemistry.opencmis.commons.impl.jaxb.RepositoryService.<init>(RepositoryService.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at
org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider$CmisServiceHolder.createServiceObject(AbstractPortProvider.java:200)
at
org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider$CmisServiceHolder.<init>(AbstractPortProvider.java:187)
at
org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.initServiceObject(AbstractPortProvider.java:514)
at
org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getPortObject(AbstractPortProvider.java:454)
at
org.apache.chemistry.opencmis.client.bindings.spi.webservices.AbstractPortProvider.getRepositoryServicePort(AbstractPortProvider.java:280)
at
org.apache.chemistry.opencmis.client.bindings.spi.webservices.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:69)
at
org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:85)
at
org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:109)
at
org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:96)
com.sun.xml.ws.api.client.ServiceInterceptorFactory: Provider
weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory is specified in
jar:file:/home/dave/Oracle/Middleware/Oracle_Home/oracle_common/modules/com.oracle.webservices.wls.wls-ws-metainf-services_2.0.0.0.jar!/META-INF/services/com.sun.xml.ws.api.client.ServiceInterceptorFactorybut could not be instantiated: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to com.sun.xml.ws.api.client.ServiceInterceptorFactory
---
<br type="_moz" />
On 2014-02-21 11:32, Dave Brosius wrote:
> I've added more to paths to my <prefer-application-packages> in my ear
>
>
> and now i get
>
> Caused by: java.lang.ClassCastException: Cannot cast
> weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
> com.sun.xml.ws.api.client.ServiceInterceptorFactory
>
> Now this SPI is found in jaxws-rt-2.2.26-6.jar and is
> javax.xml.ws.spi.Provider=com.sun.xml.ws.spi.ProviderImpl there
>
> and i have
>
> <prefer-application-packages>
> <package-name>javax.xml.ws.*</package-name>
> ....
>
>
> in my weblogic-application.xml in my ear, so it should be using that
> jar. But yet it is still picking up WLSServiceInterceptorFactory thru
> spi somehow.
>
> Anyone know what my problem is?
>
>
> ---
> <br type="_moz" />
>
> On 2014-02-20 17:08, Dave Brosius wrote:
>> It must be a classloader issue with some jar in wls, as this web app
>> fails
>>
>> package com.suckage;
>>
>> import java.io.IOException;
>> import java.net.Authenticator;
>> import java.net.PasswordAuthentication;
>> import java.util.HashMap;
>> import java.util.List;
>> import java.util.Map;
>>
>> import javax.servlet.ServletException;
>> import javax.servlet.http.HttpServlet;
>> import javax.servlet.http.HttpServletRequest;
>> import javax.servlet.http.HttpServletResponse;
>>
>> import org.apache.chemistry.opencmis.client.api.Folder;
>> import org.apache.chemistry.opencmis.client.api.Repository;
>> import org.apache.chemistry.opencmis.client.api.Session;
>> import
>> org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
>> import
>> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
>> import org.apache.chemistry.opencmis.commons.SessionParameter;
>> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>>
>> public class CmisServlet extends HttpServlet {
>>
>> private Repository repository = null;
>> private Session session = null;
>>
>> @Override
>> public void init() throws ServletException {
>> super.init();
>>
>> List<Repository> repositories =
>> SessionFactoryImpl.newInstance().getRepositories(getProps());
>>
>> for (Repository rep : repositories) {
>> if (rep.getName().equalsIgnoreCase("Main Repository")) {
>> repository = rep;
>> break;
>> }
>> }
>>
>> session = repository.createSession();
>> }
>>
>> @Override
>> protected void doGet(HttpServletRequest request,
>> HttpServletResponse response)
>> throws ServletException, IOException {
>>
>> if (session != null) {
>> Folder f = session.getRootFolder();
>>
>> response.setStatus(HttpServletResponse.SC_OK);
>>
>> response.getOutputStream().write(f.getName().getBytes("UTF-8"));
>> }
>> }
>>
>> private static Map<String, String> getProps() {
>> String wsdl =
>> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>>
>> Map<String, String> properties = new HashMap<String,
>> String>();
>> properties.put(SessionParameter.BINDING_TYPE,
>> BindingType.WEBSERVICES.value());
>> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE,
>> wsdl);
>> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE,
>> wsdl);
>>
>> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE,
>> wsdl);
>>
>> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, wsdl);
>> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
>> wsdl);
>> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
>> wsdl);
>>
>> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE,
>> wsdl);
>>
>> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, wsdl);
>>
>> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, wsdl);
>>
>> String username = "xxx";
>> String password = "yyy";
>>
>> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
>> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>>
>> properties.put(SessionParameter.USER, username);
>> properties.put(SessionParameter.PASSWORD, password);
>>
>> Authenticator.setDefault(new BasicAuthenticator(username,
>> password));
>>
>> return properties;
>> }
>>
>> static class BasicAuthenticator extends Authenticator
>> {
>> private PasswordAuthentication passwordAuthentication;
>>
>> public BasicAuthenticator(String user, String password)
>> {
>> passwordAuthentication = new PasswordAuthentication(user,
>> password.toCharArray());
>> }
>>
>> @Override
>> protected synchronized PasswordAuthentication
>> getPasswordAuthentication()
>> {
>> return passwordAuthentication;
>> }
>> }
>> }
>>
>> and this standalone succeeds
>>
>> import java.net.Authenticator;
>> import java.net.PasswordAuthentication;
>> import java.util.HashMap;
>> import java.util.List;
>> import java.util.Map;
>>
>> import org.apache.chemistry.opencmis.client.api.Folder;
>> import org.apache.chemistry.opencmis.client.api.Repository;
>> import org.apache.chemistry.opencmis.client.api.Session;
>> import
>> org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
>> import
>> org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
>> import org.apache.chemistry.opencmis.commons.SessionParameter;
>> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>>
>>
>> public class Al {
>>
>> public static void main(String[] args) {
>>
>> Map<String, String> props = getProps();
>>
>> List<Repository> repositories =
>> SessionFactoryImpl.newInstance().getRepositories(props);
>>
>> Repository repository = null;
>> for (Repository rep : repositories) {
>> if (rep.getName().equalsIgnoreCase("Main Repository")) {
>> repository = rep;
>> break;
>> }
>> }
>>
>> if (repository != null) {
>> Session session = repository.createSession();
>>
>> Folder f = session.getRootFolder();
>> System.out.println(f.getName());
>> }
>> }
>>
>> private static Map<String, String> getProps() {
>> String wsdl =
>> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>>
>> Map<String, String> properties = new HashMap<String,
>> String>();
>> properties.put(SessionParameter.BINDING_TYPE,
>> BindingType.WEBSERVICES.value());
>> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE,
>> wsdl);
>> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE,
>> wsdl);
>>
>> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE,
>> wsdl);
>>
>> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, wsdl);
>> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
>> wsdl);
>> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
>> wsdl);
>>
>> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE,
>> wsdl);
>>
>> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, wsdl);
>>
>> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, wsdl);
>>
>> String username = "xxx";
>> String password = "yyy";
>>
>> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
>> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>>
>> properties.put(SessionParameter.USER, username);
>> properties.put(SessionParameter.PASSWORD, password);
>>
>> Authenticator.setDefault(new BasicAuthenticator(username,
>> password));
>>
>> return properties;
>> }
>>
>> }
>>
>> class BasicAuthenticator extends Authenticator
>> {
>> private PasswordAuthentication passwordAuthentication;
>>
>> public BasicAuthenticator(String user, String password)
>> {
>> passwordAuthentication = new PasswordAuthentication(user,
>> password.toCharArray());
>> }
>>
>> @Override
>> protected synchronized PasswordAuthentication
>> getPasswordAuthentication()
>> {
>> return passwordAuthentication;
>> }
>> }
>>
>>
>> i even added <prefer-application-packages> like the following to try
>> to use my copies of the jars in weblogic-application.xml
>>
>> <prefer-application-packages>
>> <package-name>org.apache.chemistry.*</package-name>
>> <package-name>com.glassfish.gmbal.*</package-name>
>> <package-name>com.sun.istack.*</package-name>
>> <package-name>com.sun.xml.stream.*</package-name>
>> <package-name>com.sun.xml.ws.*</package-name>
>> <package-name>com.sun.xml.bind.*</package-name>
>> <package-name>com.sun.xml.txw2.*</package-name>
>> <package-name>org.jvnet.*</package-name>
>> <package-name>javax.xml.bind.*</package-name>
>> <package-name>javax.xml.ws.*</package-name>
>> </prefer-application-packages>
>>
>>
>>
>>
>>
>> ---
>> <br type="_moz" />
>>
>> On 2014-02-20 14:10, Dave Brosius wrote:
>>> I'm using
>>>
>>> Alfresco Community v4.0.0
>>> (4003) schema 5025
>>>
>>> The web service url is
>>>
>>> http://some.local.host.com:9080/alfresco/cmisws/RepositoryService?wsdl
>>>
>>>
>>> I decided to build a standalone app that just tested that one thing,
>>> so it would be easier to test (the real thing is part of a web app on
>>> weblogic)
>>>
>>> It works fine in the standalone app. I'm now thinking that it's a
>>> quiet jar conflict, as i had to download a bunch of jars that
>>> apparently
>>> wls was providing.
>>>
>>> I'm going to stuff all the jars i downloaded into WEB-INF/lib and see
>>> what happens.
>>>
>>> ---
>>> <br type="_moz" />
>>>
>>> On 2014-02-20 11:56, Florian Müller wrote:
>>>> Hi Dave,
>>>>
>>>> Looks like the transferred XML is somehow corrupt. All properties
>>>> became extensions.
>>>> Would it be possible to capture the response from the Alfresco
>>>> server?
>>>> Which Alfresco version are you connection to and which Alfresco CMIS
>>>> URL did you use?
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Florian
>>>>
>>>>
>>>>
>>>>> Greetings,
>>>>>
>>>>> I am running into a NPE trying to get the root folder from an
>>>>> Alfresco cmis thru chemistry 0.10.0.
>>>>>
>>>>> I'm assuming that there is some sort of configuration missing on my
>>>>> part, but i'm not sure how to debug further.
>>>>>
>>>>> Basically, when calling Session.getRootFolder it gets to
>>>>>
>>>>> SessionImpl getObject(ObjectId objectId, OperationContext context);
>>>>>
>>>>> where it fetches ObjectData, that looks like this:
>>>>>
>>>>> Object Data [properties=Properties Data
>>>>>
>>>>> [properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>> {null=cmis:allowedChildObjectTypeIds}: ,
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>> {null=cmis:objectTypeId}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>> cmis:folder],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>> {null=cmis:path}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: /],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>> {null=cmis:name}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>>>> Home],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>>> {null=cmis:creationDate}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>> 2013-11-18T19:22:26.382+05:30],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>> {null=cmis:changeToken}: ,
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>> {null=cmis:lastModifiedBy}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>> System],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>> {null=cmis:createdBy}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>> System],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>> {null=cmis:objectId}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>> {null=cmis:baseTypeId}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>> cmis:folder],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>> {null=alfcmis:nodeRef}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>>> {null=cmis:lastModificationDate}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>> 2013-11-18T19:44:23.898+05:30],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>>> {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}:
>>>>> [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets,
>>>>> {http://www.alfresco.org}properties {}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>> {propertyDefinitionId=app:icon}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>>> space-icon-default],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>> {propertyDefinitionId=cm:description}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: The
>>>>> company root space],
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>> {propertyDefinitionId=cmis:policyText}: ,
>>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>>> {propertyDefinitionId=cm:title}:
>>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>>>> Home]], {http://www.alfresco.org}appliedAspects {}: P:cm:titled,
>>>>> {http://www.alfresco.org}appliedAspects {}: P:sys:localized]]],
>>>>> allowable
>>>>> actions=Allowable Actions [allowable
>>>>> actions=[CAN_UPDATE_PROPERTIES,
>>>>> CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES,
>>>>> CAN_GET_OBJECT_RELATIONSHIPS,
>>>>> CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES, CAN_GET_CHILDREN,
>>>>> CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER, CAN_CREATE_RELATIONSHIP,
>>>>> CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event
>>>>> info=null,
>>>>> ACL=null, is exact ACL=null, policy ids=null, relationships=[],
>>>>> renditions=[]][extensions=null]
>>>>>
>>>>> It then switches on the objectData's baseTypeId
>>>>>
>>>>> which uses the entry in the properties.properties object as
>>>>>
>>>>> PropertyData<?> property =
>>>>> properties.getProperties().get("cmis:baseTypeId");
>>>>>
>>>>> but as you can see above the properties.properties collection is
>>>>> empty.
>>>>>
>>>>> since the value returned is null, the switch NPEs on me.
>>>>>
>>>>> So i'm not sure why the properties.properties collection is empty.
>>>>>
>>>>> Any help would be greatly appreciated.
>>>>>
>>>>> dave
Re: NPE trying to session.getRootFolder
Posted by Dave Brosius <db...@mebigfatguy.com>.
I've added more to paths to my <prefer-application-packages> in my ear
and now i get
Caused by: java.lang.ClassCastException: Cannot cast
weblogic.wsee.jaxws.spi.WLSServiceInterceptorFactory to
com.sun.xml.ws.api.client.ServiceInterceptorFactory
Now this SPI is found in jaxws-rt-2.2.26-6.jar and is
javax.xml.ws.spi.Provider=com.sun.xml.ws.spi.ProviderImpl there
and i have
<prefer-application-packages>
<package-name>javax.xml.ws.*</package-name>
....
in my weblogic-application.xml in my ear, so it should be using that
jar. But yet it is still picking up WLSServiceInterceptorFactory thru
spi somehow.
Anyone know what my problem is?
---
<br type="_moz" />
On 2014-02-20 17:08, Dave Brosius wrote:
> It must be a classloader issue with some jar in wls, as this web app
> fails
>
> package com.suckage;
>
> import java.io.IOException;
> import java.net.Authenticator;
> import java.net.PasswordAuthentication;
> import java.util.HashMap;
> import java.util.List;
> import java.util.Map;
>
> import javax.servlet.ServletException;
> import javax.servlet.http.HttpServlet;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
>
> import org.apache.chemistry.opencmis.client.api.Folder;
> import org.apache.chemistry.opencmis.client.api.Repository;
> import org.apache.chemistry.opencmis.client.api.Session;
> import
> org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
> import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
> import org.apache.chemistry.opencmis.commons.SessionParameter;
> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>
> public class CmisServlet extends HttpServlet {
>
> private Repository repository = null;
> private Session session = null;
>
> @Override
> public void init() throws ServletException {
> super.init();
>
> List<Repository> repositories =
> SessionFactoryImpl.newInstance().getRepositories(getProps());
>
> for (Repository rep : repositories) {
> if (rep.getName().equalsIgnoreCase("Main Repository")) {
> repository = rep;
> break;
> }
> }
>
> session = repository.createSession();
> }
>
> @Override
> protected void doGet(HttpServletRequest request,
> HttpServletResponse response)
> throws ServletException, IOException {
>
> if (session != null) {
> Folder f = session.getRootFolder();
>
> response.setStatus(HttpServletResponse.SC_OK);
>
> response.getOutputStream().write(f.getName().getBytes("UTF-8"));
> }
> }
>
> private static Map<String, String> getProps() {
> String wsdl =
> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>
> Map<String, String> properties = new HashMap<String, String>();
> properties.put(SessionParameter.BINDING_TYPE,
> BindingType.WEBSERVICES.value());
> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, wsdl);
> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE,
> wsdl);
>
> String username = "xxx";
> String password = "yyy";
>
> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>
> properties.put(SessionParameter.USER, username);
> properties.put(SessionParameter.PASSWORD, password);
>
> Authenticator.setDefault(new BasicAuthenticator(username,
> password));
>
> return properties;
> }
>
> static class BasicAuthenticator extends Authenticator
> {
> private PasswordAuthentication passwordAuthentication;
>
> public BasicAuthenticator(String user, String password)
> {
> passwordAuthentication = new PasswordAuthentication(user,
> password.toCharArray());
> }
>
> @Override
> protected synchronized PasswordAuthentication
> getPasswordAuthentication()
> {
> return passwordAuthentication;
> }
> }
> }
>
> and this standalone succeeds
>
> import java.net.Authenticator;
> import java.net.PasswordAuthentication;
> import java.util.HashMap;
> import java.util.List;
> import java.util.Map;
>
> import org.apache.chemistry.opencmis.client.api.Folder;
> import org.apache.chemistry.opencmis.client.api.Repository;
> import org.apache.chemistry.opencmis.client.api.Session;
> import
> org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
> import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
> import org.apache.chemistry.opencmis.commons.SessionParameter;
> import org.apache.chemistry.opencmis.commons.enums.BindingType;
>
>
> public class Al {
>
> public static void main(String[] args) {
>
> Map<String, String> props = getProps();
>
> List<Repository> repositories =
> SessionFactoryImpl.newInstance().getRepositories(props);
>
> Repository repository = null;
> for (Repository rep : repositories) {
> if (rep.getName().equalsIgnoreCase("Main Repository")) {
> repository = rep;
> break;
> }
> }
>
> if (repository != null) {
> Session session = repository.createSession();
>
> Folder f = session.getRootFolder();
> System.out.println(f.getName());
> }
> }
>
> private static Map<String, String> getProps() {
> String wsdl =
> "http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
>
> Map<String, String> properties = new HashMap<String, String>();
> properties.put(SessionParameter.BINDING_TYPE,
> BindingType.WEBSERVICES.value());
> properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
> properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, wsdl);
> properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
> wsdl);
>
> properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE,
> wsdl);
> properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE,
> wsdl);
>
> String username = "xxx";
> String password = "yyy";
>
> properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
> CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
>
> properties.put(SessionParameter.USER, username);
> properties.put(SessionParameter.PASSWORD, password);
>
> Authenticator.setDefault(new BasicAuthenticator(username,
> password));
>
> return properties;
> }
>
> }
>
> class BasicAuthenticator extends Authenticator
> {
> private PasswordAuthentication passwordAuthentication;
>
> public BasicAuthenticator(String user, String password)
> {
> passwordAuthentication = new PasswordAuthentication(user,
> password.toCharArray());
> }
>
> @Override
> protected synchronized PasswordAuthentication
> getPasswordAuthentication()
> {
> return passwordAuthentication;
> }
> }
>
>
> i even added <prefer-application-packages> like the following to try
> to use my copies of the jars in weblogic-application.xml
>
> <prefer-application-packages>
> <package-name>org.apache.chemistry.*</package-name>
> <package-name>com.glassfish.gmbal.*</package-name>
> <package-name>com.sun.istack.*</package-name>
> <package-name>com.sun.xml.stream.*</package-name>
> <package-name>com.sun.xml.ws.*</package-name>
> <package-name>com.sun.xml.bind.*</package-name>
> <package-name>com.sun.xml.txw2.*</package-name>
> <package-name>org.jvnet.*</package-name>
> <package-name>javax.xml.bind.*</package-name>
> <package-name>javax.xml.ws.*</package-name>
> </prefer-application-packages>
>
>
>
>
>
> ---
> <br type="_moz" />
>
> On 2014-02-20 14:10, Dave Brosius wrote:
>> I'm using
>>
>> Alfresco Community v4.0.0
>> (4003) schema 5025
>>
>> The web service url is
>>
>> http://some.local.host.com:9080/alfresco/cmisws/RepositoryService?wsdl
>>
>>
>> I decided to build a standalone app that just tested that one thing,
>> so it would be easier to test (the real thing is part of a web app on
>> weblogic)
>>
>> It works fine in the standalone app. I'm now thinking that it's a
>> quiet jar conflict, as i had to download a bunch of jars that
>> apparently
>> wls was providing.
>>
>> I'm going to stuff all the jars i downloaded into WEB-INF/lib and see
>> what happens.
>>
>> ---
>> <br type="_moz" />
>>
>> On 2014-02-20 11:56, Florian Müller wrote:
>>> Hi Dave,
>>>
>>> Looks like the transferred XML is somehow corrupt. All properties
>>> became extensions.
>>> Would it be possible to capture the response from the Alfresco
>>> server?
>>> Which Alfresco version are you connection to and which Alfresco CMIS
>>> URL did you use?
>>>
>>>
>>> Thanks,
>>>
>>> Florian
>>>
>>>
>>>
>>>> Greetings,
>>>>
>>>> I am running into a NPE trying to get the root folder from an
>>>> Alfresco cmis thru chemistry 0.10.0.
>>>>
>>>> I'm assuming that there is some sort of configuration missing on my
>>>> part, but i'm not sure how to debug further.
>>>>
>>>> Basically, when calling Session.getRootFolder it gets to
>>>>
>>>> SessionImpl getObject(ObjectId objectId, OperationContext context);
>>>>
>>>> where it fetches ObjectData, that looks like this:
>>>>
>>>> Object Data [properties=Properties Data
>>>>
>>>> [properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=cmis:allowedChildObjectTypeIds}: ,
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=cmis:objectTypeId}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> cmis:folder],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {null=cmis:path}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: /],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {null=cmis:name}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>>> Home],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>> {null=cmis:creationDate}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> 2013-11-18T19:22:26.382+05:30],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {null=cmis:changeToken}: ,
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {null=cmis:lastModifiedBy}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {null=cmis:createdBy}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=cmis:objectId}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=cmis:baseTypeId}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> cmis:folder],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=alfcmis:nodeRef}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>>> {null=cmis:lastModificationDate}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> 2013-11-18T19:44:23.898+05:30],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>>> {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}:
>>>> [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets,
>>>> {http://www.alfresco.org}properties {}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {propertyDefinitionId=app:icon}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>>> space-icon-default],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {propertyDefinitionId=cm:description}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: The
>>>> company root space],
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {propertyDefinitionId=cmis:policyText}: ,
>>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>>> {propertyDefinitionId=cm:title}:
>>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>>> Home]], {http://www.alfresco.org}appliedAspects {}: P:cm:titled,
>>>> {http://www.alfresco.org}appliedAspects {}: P:sys:localized]]],
>>>> allowable
>>>> actions=Allowable Actions [allowable actions=[CAN_UPDATE_PROPERTIES,
>>>> CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES,
>>>> CAN_GET_OBJECT_RELATIONSHIPS,
>>>> CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES, CAN_GET_CHILDREN,
>>>> CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER, CAN_CREATE_RELATIONSHIP,
>>>> CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event
>>>> info=null,
>>>> ACL=null, is exact ACL=null, policy ids=null, relationships=[],
>>>> renditions=[]][extensions=null]
>>>>
>>>> It then switches on the objectData's baseTypeId
>>>>
>>>> which uses the entry in the properties.properties object as
>>>>
>>>> PropertyData<?> property =
>>>> properties.getProperties().get("cmis:baseTypeId");
>>>>
>>>> but as you can see above the properties.properties collection is
>>>> empty.
>>>>
>>>> since the value returned is null, the switch NPEs on me.
>>>>
>>>> So i'm not sure why the properties.properties collection is empty.
>>>>
>>>> Any help would be greatly appreciated.
>>>>
>>>> dave
Re: NPE trying to session.getRootFolder
Posted by Dave Brosius <db...@mebigfatguy.com>.
It must be a classloader issue with some jar in wls, as this web app
fails
package com.suckage;
import java.io.IOException;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.chemistry.opencmis.client.api.Folder;
import org.apache.chemistry.opencmis.client.api.Repository;
import org.apache.chemistry.opencmis.client.api.Session;
import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
import org.apache.chemistry.opencmis.commons.SessionParameter;
import org.apache.chemistry.opencmis.commons.enums.BindingType;
public class CmisServlet extends HttpServlet {
private Repository repository = null;
private Session session = null;
@Override
public void init() throws ServletException {
super.init();
List<Repository> repositories =
SessionFactoryImpl.newInstance().getRepositories(getProps());
for (Repository rep : repositories) {
if (rep.getName().equalsIgnoreCase("Main Repository")) {
repository = rep;
break;
}
}
session = repository.createSession();
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
if (session != null) {
Folder f = session.getRootFolder();
response.setStatus(HttpServletResponse.SC_OK);
response.getOutputStream().write(f.getName().getBytes("UTF-8"));
}
}
private static Map<String, String> getProps() {
String wsdl =
"http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
Map<String, String> properties = new HashMap<String, String>();
properties.put(SessionParameter.BINDING_TYPE,
BindingType.WEBSERVICES.value());
properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, wsdl);
properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE,
wsdl);
String username = "xxx";
String password = "yyy";
properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
properties.put(SessionParameter.USER, username);
properties.put(SessionParameter.PASSWORD, password);
Authenticator.setDefault(new BasicAuthenticator(username,
password));
return properties;
}
static class BasicAuthenticator extends Authenticator
{
private PasswordAuthentication passwordAuthentication;
public BasicAuthenticator(String user, String password)
{
passwordAuthentication = new PasswordAuthentication(user,
password.toCharArray());
}
@Override
protected synchronized PasswordAuthentication
getPasswordAuthentication()
{
return passwordAuthentication;
}
}
}
and this standalone succeeds
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.chemistry.opencmis.client.api.Folder;
import org.apache.chemistry.opencmis.client.api.Repository;
import org.apache.chemistry.opencmis.client.api.Session;
import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
import org.apache.chemistry.opencmis.commons.SessionParameter;
import org.apache.chemistry.opencmis.commons.enums.BindingType;
public class Al {
public static void main(String[] args) {
Map<String, String> props = getProps();
List<Repository> repositories =
SessionFactoryImpl.newInstance().getRepositories(props);
Repository repository = null;
for (Repository rep : repositories) {
if (rep.getName().equalsIgnoreCase("Main Repository")) {
repository = rep;
break;
}
}
if (repository != null) {
Session session = repository.createSession();
Folder f = session.getRootFolder();
System.out.println(f.getName());
}
}
private static Map<String, String> getProps() {
String wsdl =
"http://10.177.101.190:9080/alfresco/cmisws/RepositoryService?wsdl";
Map<String, String> properties = new HashMap<String, String>();
properties.put(SessionParameter.BINDING_TYPE,
BindingType.WEBSERVICES.value());
properties.put(SessionParameter.WEBSERVICES_ACL_SERVICE, wsdl);
properties.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, wsdl);
properties.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE,
wsdl);
properties.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE,
wsdl);
String username = "xxx";
String password = "yyy";
properties.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS,
CmisBindingFactory.STANDARD_AUTHENTICATION_PROVIDER);
properties.put(SessionParameter.USER, username);
properties.put(SessionParameter.PASSWORD, password);
Authenticator.setDefault(new BasicAuthenticator(username,
password));
return properties;
}
}
class BasicAuthenticator extends Authenticator
{
private PasswordAuthentication passwordAuthentication;
public BasicAuthenticator(String user, String password)
{
passwordAuthentication = new PasswordAuthentication(user,
password.toCharArray());
}
@Override
protected synchronized PasswordAuthentication
getPasswordAuthentication()
{
return passwordAuthentication;
}
}
i even added <prefer-application-packages> like the following to try to
use my copies of the jars in weblogic-application.xml
<prefer-application-packages>
<package-name>org.apache.chemistry.*</package-name>
<package-name>com.glassfish.gmbal.*</package-name>
<package-name>com.sun.istack.*</package-name>
<package-name>com.sun.xml.stream.*</package-name>
<package-name>com.sun.xml.ws.*</package-name>
<package-name>com.sun.xml.bind.*</package-name>
<package-name>com.sun.xml.txw2.*</package-name>
<package-name>org.jvnet.*</package-name>
<package-name>javax.xml.bind.*</package-name>
<package-name>javax.xml.ws.*</package-name>
</prefer-application-packages>
---
<br type="_moz" />
On 2014-02-20 14:10, Dave Brosius wrote:
> I'm using
>
> Alfresco Community v4.0.0
> (4003) schema 5025
>
> The web service url is
>
> http://some.local.host.com:9080/alfresco/cmisws/RepositoryService?wsdl
>
>
> I decided to build a standalone app that just tested that one thing,
> so it would be easier to test (the real thing is part of a web app on
> weblogic)
>
> It works fine in the standalone app. I'm now thinking that it's a
> quiet jar conflict, as i had to download a bunch of jars that
> apparently
> wls was providing.
>
> I'm going to stuff all the jars i downloaded into WEB-INF/lib and see
> what happens.
>
> ---
> <br type="_moz" />
>
> On 2014-02-20 11:56, Florian Müller wrote:
>> Hi Dave,
>>
>> Looks like the transferred XML is somehow corrupt. All properties
>> became extensions.
>> Would it be possible to capture the response from the Alfresco server?
>> Which Alfresco version are you connection to and which Alfresco CMIS
>> URL did you use?
>>
>>
>> Thanks,
>>
>> Florian
>>
>>
>>
>>> Greetings,
>>>
>>> I am running into a NPE trying to get the root folder from an
>>> Alfresco cmis thru chemistry 0.10.0.
>>>
>>> I'm assuming that there is some sort of configuration missing on my
>>> part, but i'm not sure how to debug further.
>>>
>>> Basically, when calling Session.getRootFolder it gets to
>>>
>>> SessionImpl getObject(ObjectId objectId, OperationContext context);
>>>
>>> where it fetches ObjectData, that looks like this:
>>>
>>> Object Data [properties=Properties Data
>>>
>>> [properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>> {null=cmis:allowedChildObjectTypeIds}: ,
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>> {null=cmis:objectTypeId}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>> cmis:folder],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>> {null=cmis:path}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: /],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>> {null=cmis:name}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>> Home],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>> {null=cmis:creationDate}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>> 2013-11-18T19:22:26.382+05:30],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>> {null=cmis:changeToken}: ,
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>> {null=cmis:lastModifiedBy}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>> {null=cmis:createdBy}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>> {null=cmis:objectId}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>> {null=cmis:baseTypeId}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>> cmis:folder],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>> {null=alfcmis:nodeRef}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>>> {null=cmis:lastModificationDate}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>> 2013-11-18T19:44:23.898+05:30],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>>> {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}:
>>> [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets,
>>> {http://www.alfresco.org}properties {}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>> {propertyDefinitionId=app:icon}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>>> space-icon-default],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>> {propertyDefinitionId=cm:description}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: The
>>> company root space],
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>> {propertyDefinitionId=cmis:policyText}: ,
>>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>>> {propertyDefinitionId=cm:title}:
>>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>>> Home]], {http://www.alfresco.org}appliedAspects {}: P:cm:titled,
>>> {http://www.alfresco.org}appliedAspects {}: P:sys:localized]]],
>>> allowable
>>> actions=Allowable Actions [allowable actions=[CAN_UPDATE_PROPERTIES,
>>> CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES,
>>> CAN_GET_OBJECT_RELATIONSHIPS,
>>> CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES, CAN_GET_CHILDREN,
>>> CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER, CAN_CREATE_RELATIONSHIP,
>>> CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event
>>> info=null,
>>> ACL=null, is exact ACL=null, policy ids=null, relationships=[],
>>> renditions=[]][extensions=null]
>>>
>>> It then switches on the objectData's baseTypeId
>>>
>>> which uses the entry in the properties.properties object as
>>>
>>> PropertyData<?> property =
>>> properties.getProperties().get("cmis:baseTypeId");
>>>
>>> but as you can see above the properties.properties collection is
>>> empty.
>>>
>>> since the value returned is null, the switch NPEs on me.
>>>
>>> So i'm not sure why the properties.properties collection is empty.
>>>
>>> Any help would be greatly appreciated.
>>>
>>> dave
Re: NPE trying to session.getRootFolder
Posted by Dave Brosius <db...@mebigfatguy.com>.
I'm using
Alfresco Community v4.0.0
(4003) schema 5025
The web service url is
http://some.local.host.com:9080/alfresco/cmisws/RepositoryService?wsdl
I decided to build a standalone app that just tested that one thing, so
it would be easier to test (the real thing is part of a web app on
weblogic)
It works fine in the standalone app. I'm now thinking that it's a quiet
jar conflict, as i had to download a bunch of jars that apparently
wls was providing.
I'm going to stuff all the jars i downloaded into WEB-INF/lib and see
what happens.
---
<br type="_moz" />
On 2014-02-20 11:56, Florian Müller wrote:
> Hi Dave,
>
> Looks like the transferred XML is somehow corrupt. All properties
> became extensions.
> Would it be possible to capture the response from the Alfresco server?
> Which Alfresco version are you connection to and which Alfresco CMIS
> URL did you use?
>
>
> Thanks,
>
> Florian
>
>
>
>> Greetings,
>>
>> I am running into a NPE trying to get the root folder from an
>> Alfresco cmis thru chemistry 0.10.0.
>>
>> I'm assuming that there is some sort of configuration missing on my
>> part, but i'm not sure how to debug further.
>>
>> Basically, when calling Session.getRootFolder it gets to
>>
>> SessionImpl getObject(ObjectId objectId, OperationContext context);
>>
>> where it fetches ObjectData, that looks like this:
>>
>> Object Data [properties=Properties Data
>>
>> [properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>> {null=cmis:allowedChildObjectTypeIds}: ,
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>> {null=cmis:objectTypeId}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>> cmis:folder],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>> {null=cmis:path}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: /],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>> {null=cmis:name}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>> Home],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>> {null=cmis:creationDate}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>> 2013-11-18T19:22:26.382+05:30],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>> {null=cmis:changeToken}: ,
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>> {null=cmis:lastModifiedBy}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>> {null=cmis:createdBy}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>> {null=cmis:objectId}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>> {null=cmis:baseTypeId}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>> cmis:folder],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>> {null=alfcmis:nodeRef}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
>> {null=cmis:lastModificationDate}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>> 2013-11-18T19:44:23.898+05:30],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
>> {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}:
>> [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets,
>> {http://www.alfresco.org}properties {}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>> {propertyDefinitionId=app:icon}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
>> space-icon-default],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>> {propertyDefinitionId=cm:description}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: The
>> company root space],
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>> {propertyDefinitionId=cmis:policyText}: ,
>> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
>> {propertyDefinitionId=cm:title}:
>> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
>> Home]], {http://www.alfresco.org}appliedAspects {}: P:cm:titled,
>> {http://www.alfresco.org}appliedAspects {}: P:sys:localized]]],
>> allowable
>> actions=Allowable Actions [allowable actions=[CAN_UPDATE_PROPERTIES,
>> CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES, CAN_GET_OBJECT_RELATIONSHIPS,
>> CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES, CAN_GET_CHILDREN,
>> CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER, CAN_CREATE_RELATIONSHIP,
>> CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event info=null,
>> ACL=null, is exact ACL=null, policy ids=null, relationships=[],
>> renditions=[]][extensions=null]
>>
>> It then switches on the objectData's baseTypeId
>>
>> which uses the entry in the properties.properties object as
>>
>> PropertyData<?> property =
>> properties.getProperties().get("cmis:baseTypeId");
>>
>> but as you can see above the properties.properties collection is
>> empty.
>>
>> since the value returned is null, the switch NPEs on me.
>>
>> So i'm not sure why the properties.properties collection is empty.
>>
>> Any help would be greatly appreciated.
>>
>> dave
Re: NPE trying to session.getRootFolder
Posted by Florian Müller <fm...@apache.org>.
Hi Dave,
Looks like the transferred XML is somehow corrupt. All properties
became extensions.
Would it be possible to capture the response from the Alfresco server?
Which Alfresco version are you connection to and which Alfresco CMIS
URL did you use?
Thanks,
Florian
> Greetings,
>
> I am running into a NPE trying to get the root folder from an
> Alfresco cmis thru chemistry 0.10.0.
>
> I'm assuming that there is some sort of configuration missing on my
> part, but i'm not sure how to debug further.
>
> Basically, when calling Session.getRootFolder it gets to
>
> SessionImpl getObject(ObjectId objectId, OperationContext context);
>
> where it fetches ObjectData, that looks like this:
>
> Object Data [properties=Properties Data
>
> [properties=[]][extensions=[{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
> {null=cmis:allowedChildObjectTypeIds}: ,
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
> {null=cmis:objectTypeId}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
> cmis:folder],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
> {null=cmis:path}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: /],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
> {null=cmis:name}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
> Home],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
> {null=cmis:creationDate}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
> 2013-11-18T19:22:26.382+05:30],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
> {null=cmis:changeToken}: ,
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
> {null=cmis:lastModifiedBy}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
> {null=cmis:createdBy}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: System],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
> {null=cmis:objectId}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
> {null=cmis:baseTypeId}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
> cmis:folder],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
> {null=alfcmis:nodeRef}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
> workspace://SpacesStore/03ceb69e-5168-4f1c-a3b4-64cbb2ad4bf7],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyDateTime
> {null=cmis:lastModificationDate}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
> 2013-11-18T19:44:23.898+05:30],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyId
> {null=cmis:parentId}: , {http://www.alfresco.org}aspects {}:
> [{http://www.alfresco.org}appliedAspects {}: P:app:uifacets,
> {http://www.alfresco.org}properties {}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
> {propertyDefinitionId=app:icon}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}:
> space-icon-default],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
> {propertyDefinitionId=cm:description}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: The
> company root space],
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
> {propertyDefinitionId=cmis:policyText}: ,
> {http://docs.oasis-open.org/ns/cmis/core/200908/}propertyString
> {propertyDefinitionId=cm:title}:
> [{http://docs.oasis-open.org/ns/cmis/core/200908/}value {}: Company
> Home]], {http://www.alfresco.org}appliedAspects {}: P:cm:titled,
> {http://www.alfresco.org}appliedAspects {}: P:sys:localized]]],
> allowable
> actions=Allowable Actions [allowable actions=[CAN_UPDATE_PROPERTIES,
> CAN_GET_FOLDER_TREE, CAN_GET_PROPERTIES,
> CAN_GET_OBJECT_RELATIONSHIPS,
> CAN_GET_DESCENDANTS, CAN_GET_APPLIED_POLICIES, CAN_GET_CHILDREN,
> CAN_CREATE_DOCUMENT, CAN_CREATE_FOLDER, CAN_CREATE_RELATIONSHIP,
> CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null], change event
> info=null,
> ACL=null, is exact ACL=null, policy ids=null, relationships=[],
> renditions=[]][extensions=null]
>
> It then switches on the objectData's baseTypeId
>
> which uses the entry in the properties.properties object as
>
> PropertyData<?> property =
> properties.getProperties().get("cmis:baseTypeId");
>
> but as you can see above the properties.properties collection is
> empty.
>
> since the value returned is null, the switch NPEs on me.
>
> So i'm not sure why the properties.properties collection is empty.
>
> Any help would be greatly appreciated.
>
> dave