chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Chow <alexander.c...@liferay.com>
Subject Re: RV: first steps with opencmis for java
Date Thu, 24 Mar 2011 23:09:52 GMT
Hi there,

It looks like you have a typo in your parameters..  you have:

           parameter.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
> "http:/localhost:8080/alfresco/cmis/NavigationService?wsdl");
>

but you are missing a "/" after the "http:"... it only has one.


Alex


On Thu, Mar 24, 2011 at 7:28 PM, <javieras@um.es> wrote:

>
>
> Hi all,
>
>
>
> First, sorry for my english. I´m from Spain. Second …  I’m going crazy!
>
>
>
> I have the last alfresco community edition and I work with Eclipse and
> OpenCmis. I want to list the children of the root folder … and I can’t !! I
> don’t know why. I follow the examples codes, but not work. I write :
>
>
>
>            // default factory implementation
>
>            SessionFactory factory = SessionFactoryImpl.newInstance();
>
>            Map<String, String> parameter = new HashMap<String, String>();
>
>
>
>            // user credentials
>
>            parameter.put(SessionParameter.USER, "admin");
>
>            parameter.put(SessionParameter.PASSWORD, "alfresco");
>
>
>
>            // connection settings
>
>            parameter.put(SessionParameter.BINDING_TYPE,
> BindingType.WEBSERVICES.value());
>
>            parameter.put(SessionParameter.WEBSERVICES_ACL_SERVICE,
> "http://localhost:8080/alfresco/cmis/ACLService?wsdl");
>
>            parameter.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE,
> "http:/localhost:8080/alfrecso/cmis/DiscoveryService?wsdl");
>
>            parameter.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE,
> "http://localhost:8080/alfresco/cmis/MultiFilingService?wsdl");
>
>            parameter.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE,
> "http:/localhost:8080/alfresco/cmis/NavigationService?wsdl");
>
>            parameter.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE,
> "http://localhost:8080/alfresco/cmis/ObjectService?wsdl");
>
>            parameter.put(SessionParameter.WEBSERVICES_POLICY_SERVICE,
> "http://localhost:8080/alfresco/cmis/PolicyService?wsdl");
>
>            parameter.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE,
> "http://localhost:8080/alfresco/cmis/RelationshipService?wsdl");
>
>            parameter.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE,
> "http://localhost:8080/alfresco/cmis/RepositoryService?wsdl");
>
>            parameter.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE,
> "http:/localhost:8080/alfresco/cmis/VersioningService?wsdl");
>
>            parameter.put(SessionParameter.REPOSITORY_ID,
> "9548ff2a-c0f5-4ddc-ba68-0421d2d1784d");
>
>
>
>            // create session
>
>            Session session = factory.createSession(parameter);
>
>
>
>            Folder root = session.getRootFolder();
>
>
>
>            ItemIterable<CmisObject> children = root.getChildren();
>
>
>
>            for (CmisObject o : children) {
>
>              System.out.println(o.getName());
>
>            }
>
>
>
> All is ok, the repository_id, the credentials … but in this line : for
> (CmisObject o : children ){ throws the exception :
>
>
>
> Exception in thread "main"
> org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException:
> Cannot initalize Web Services service object
> [org.apache.chemistry.opencmis.binding.webservices.NavigationService]: null
>
>      at
>
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.PortProvider.i
> nitServiceObject(PortProvider.java:256)
>
>      at
>
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.PortProvider.g
> etPortObject(PortProvider.java:205)
>
>      at
>
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.PortProvider.g
> etNavigationServicePort(PortProvider.java:108)
>
>      at
>
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.NavigationServ
> iceImpl.getChildren(NavigationServiceImpl.java:75)
>
>      at
>
> org.apache.chemistry.opencmis.client.runtime.FolderImpl$2.fetchPage(FolderIm
> pl.java:259)
>
>      at
>
> org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurren
> tPage(AbstractIterator.java:132)
>
>      at
>
> org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext
> (CollectionIterator.java:48)
>
>      at es.upct.pfc.cliente.lanzador.main(lanzador.java:75)
>
> Caused by: java.lang.NullPointerException
>
>      at sun.net.www.ParseUtil.toURI(ParseUtil.java:261)
>
>      at
>
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.j
> ava:905)
>
>      at
>
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:8
> 36)
>
>      at
>
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
> .java:1172)
>
>      at java.net.URL.openStream(URL.java:1010)
>
>      at
>
> com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.
> java:804)
>
>      at
>
> com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.j
> ava:262)
>
>      at
>
> com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:12
> 9)
>
>      at
>
> com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:265
> )
>
>      at
> com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:228)
>
>      at
> com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:176)
>
>      at
>
> com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:104)
>
>      at javax.xml.ws.Service.<init>(Service.java:56)
>
>      at
>
> org.apache.chemistry.opencmis.commons.impl.jaxb.NavigationService.<init>(Nav
> igationService.java:42)
>
>      at
>
> org.apache.chemistry.opencmis.client.bindings.spi.webservices.PortProvider.i
> nitServiceObject(PortProvider.java:235)
>
>      ... 7 more
>
>
>
> And I am desperate … any idea? Thanks you so much in advice.
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message