掲示板

CompanyService SOAP service addCompany not working

10年前 に Manuel Felipe Lopez によって更新されました。

CompanyService SOAP service addCompany not working

New Member 投稿: 4 参加年月日: 09/01/07 最新の投稿
Hi All,

I'm trying to automate our initial dev setup. For this, we basically want a set of preexisting instances in a new Liferay 6.2 installation. I was trying to use the existing SOAP services, specifically, the CompanyServer - addCompany method. Everything looks fine from the webservice call perspective, i get a 200 http code after calling the method. If i go to the instance administrator in the web ui, the instance is there and ready to use, no errors in log files so far.

Now, when i try to access to new instance using the virtual host url, login works, when then, when i click the + image to add a new page, a get this error:


15:19:34,368 ERROR [http-bio-8080-exec-4][IncludeTag:129] Current URL /home?p_p_id=145&p_p_lifecycle=0&p_p_state=exclusive&p_p_mode=view&_145_viewEntries=true&_145_stateMaximized=false&_145_struts_action=%2Fdockbar%2Fadd_panel generates exception: null
java.lang.NullPointerException
	at com.liferay.portal.util.PortletCategoryUtil.getRelevantPortletCategory(PortletCategoryUtil.java:63)
	at com.liferay.portal.util.PortletCategoryUtil.getRelevantPortletCategory(PortletCategoryUtil.java:50)
	at org.apache.jsp.html.portlet.dockbar.add_005fapplication_jsp._jspService(add_005fapplication_jsp.java:946)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
	at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
	at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
	at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
	at org.apache.jsp.html.portlet.dockbar.add_005fpanel_jsp._jspx_meth_liferay_002dutil_005finclude_005f1(add_005fpanel_jsp.java:968)
	at org.apache.jsp.html.portlet.dockbar.add_005fpanel_jsp._jspService(add_005fpanel_jsp.java:750)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
	at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
	at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
15:19:34,394 ERROR [http-bio-8080-exec-4][IncludeTag:129] Current URL /home?p_p_id=145&p_p_lifecycle=0&p_p_state=exclusive&p_p_mode=view&_145_viewEntries=true&_145_stateMaximized=false&_145_struts_action=%2Fdockbar%2Fadd_panel generates exception: null
java.lang.NullPointerException
	at com.liferay.portal.util.PortletListerImpl.getTreeView(PortletListerImpl.java:74)
	at org.apache.jsp.html.portal.layout.edit.panel_jsp._jspService(panel_jsp.java:710)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
	at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
	at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
	at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
	at org.apache.jsp.html.portlet.layouts_005fadmin.add_005flayout_jsp._jspService(add_005flayout_jsp.java:2000)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


If i go to the page tab, i see nothing, completely blank. Any clues ?

If helpful, im using a a ruby client:

require 'savon'
require 'nokogiri'
require 'active_support/core_ext/hash/conversions'

company_client = Savon.client(wsdl: "http://localhost:8080/api/axis/Portal_CompanyService?wsdl", basic_auth: ["theuserscreen", "thepasswd"])
response = company_client.call(:add_company, message: { webId: "instanceautomate", virtualHost: "the.host.ca", mx: "host.ca", system: false, maxUsers: 0, active: true})


The response



D, [2014-02-10T15:16:09.557844 #6527] DEBUG -- : HTTPI GET request to localhost (net_http)
I, [2014-02-10T15:16:09.806761 #6527]  INFO -- : SOAP request: http://localhost:8080/api/axis/Portal_CompanyService
I, [2014-02-10T15:16:09.807016 #6527]  INFO -- : SOAPAction: "addCompany", Content-Type: text/xml;charset=UTF-8, Content-Length: 535
D, [2014-02-10T15:16:09.807275 #6527] DEBUG -- : <!--?xml version="1.0" encoding="UTF-8"?--><env:envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:impl="urn:http.service.portal.liferay.com" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="http://model.portal.liferay.com"><env:body><impl:addcompany><webid>devopsautomate04</webid><virtualhost>the.host.ca</virtualhost><mx>host.ca</mx><system>false</system><maxusers>0</maxusers><active>true</active></impl:addcompany></env:body></env:envelope>
D, [2014-02-10T15:16:09.807924 #6527] DEBUG -- : HTTPI POST request to localhost (net_http)
I, [2014-02-10T15:16:11.439124 #6527]  INFO -- : SOAP response (status 200)
D, [2014-02-10T15:16:11.439191 #6527] DEBUG -- : <!--?xml version="1.0" encoding="UTF-8"?--><soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:body><ns1:addcompanyresponse soapenv:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:http.service.portal.liferay.com"><addcompanyreturn href="#id0" /></ns1:addcompanyresponse><multiref id="id0" soapenc:root="0" soapenv:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:CompanySoap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://model.portal.liferay.com"><accountid href="#id1" /><active href="#id2" /><companyid href="#id3" /><homeurl xsi:type="soapenc:string"></homeurl><key xsi:type="soapenc:string">rO0ABXNyAB9qYXZheC5jcnlwdG8uc3BlYy5TZWNyZXRLZXlTcGVjW0cLZuIwYU0CAAJMAAlhbGdvcml0aG10ABJMamF2YS9sYW5nL1N0cmluZztbAANrZXl0AAJbQnhwdAADQUVTdXIAAltCrPMX+AYIVOACAAB4cAAAABDE1VkV4POe+I/5VabAzBCI</key><logoid href="#id4" /><maxusers href="#id5" /><mx xsi:type="soapenc:string">host.ca</mx><primarykey href="#id6" /><system href="#id7" /><webid xsi:type="soapenc:string">devopsautomate04</webid></multiref>
.....

</soapenv:body></soapenv:envelope>


Thanks

-
Manuel
9年前 に Mark Dawson によって更新されました。

RE: CompanyService SOAP service addCompany not working

New Member 投稿: 2 参加年月日: 14/01/25 最新の投稿
I get the same problem using a simple action class in a portlet.


			company = CompanyLocalServiceUtil.addCompany(webId, 
					virtualHostname, 
					mx, 
					shardName, 
					system, 
					maxUsers, 
					active);

I noticed if you create the instance and restart the liferay service the problem goes away.

I'm assuming it's a startup index or something forcing it to initialize properly. Though that's no good. The instance functions the same way as it would built in the control panel.

I tried redeploying themes, deactivating then reactivating the instance, running server administration utilities manually. There's not a whole lot I could find.

I think there's something like PortalInstances.initCompany( ... ) but I'm scratching my head on how to get it working in my class. I would love to hear some insight on this.