留言板

PermissionChecker not initialized error while calling Liferay Web Service

jay b teraiya,修改在15 年前。

PermissionChecker not initialized error while calling Liferay Web Service

New Member 帖子: 12 加入日期: 08-12-5 最近的帖子
Hi All,

I am trying to call Liferay web service via my client program.
Liferay and Client program are installed on the same machine.

My Client program tries to call the Liferay Web Service and gets error "PermissionChecker not initialized" at server end and at client side as well.

1) My Client Program.

package com.liferay.portal.service.http;

import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.rpc.Stub;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPHeaderElement;
import com.liferay.portal.model.UserSoap;

public class TestLiferayPortalUserService
{
public static void main(String args[])
{

try
{
UserServiceSoapService service = new UserServiceSoapServiceLocator();
UserServiceSoap userService = service.getPortal_UserService(new URL("http://localhost:8080/tunnel-web/axis/Portal_UserService"));
((Portal_UserServiceSoapBindingStub)userService).setUsername("test@liferay.com");
((Portal_UserServiceSoapBindingStub)userService).setPassword("qUqP5cyxm6YcTAhz05Hph5gvu9M=");

System.out.println("User ID is ..... "+userService.getUserIdByEmailAddress(1, "test@liferay.com"));

}
catch(Exception e)
{
e.printStackTrace();
System.out.println(e);
}
}
}

2) Client side exception

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.rmi.RemoteException: PermissionChecker not initialized
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostnameemoticonS3443

java.rmi.RemoteException: PermissionChecker not initialized
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.liferay.portal.service.http.Portal_UserServiceSoapBindingStub.getUserIdByEmailAddress(Portal_UserServiceSoapBindingStub.java:1037)
at com.liferay.portal.service.http.TestLiferayPortalUserService.main(TestLiferayPortalUserService.java:52)
java.rmi.RemoteException: PermissionChecker not initialized

3) Server side exception

07:46:36,096 ERROR [UserServiceSoap:60] com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialize
com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialized
at com.liferay.portal.service.base.PrincipalBean.getPermissionChecker(PrincipalBean.java:77)
at com.liferay.portal.service.impl.UserServiceImpl.getUserByEmailAddress(UserServiceImpl.java:208)
at com.liferay.portal.service.impl.UserServiceImpl.getUserIdByEmailAddress(UserServiceImpl.java:240)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy102.getUserIdByEmailAddress(Unknown Source)
at com.liferay.portal.service.UserServiceUtil.getUserIdByEmailAddress(UserServiceUtil.java:139)
at com.liferay.portal.service.http.UserServiceSoap.getUserIdByEmailAddress(UserServiceSoap.java:254)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at com.liferay.portal.servlet.AxisServlet.service(AxisServlet.java:81)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at com.liferay.portal.kernel.servlet.PortalClassLoaderServlet.service(PortalClassLoaderServlet.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:282)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:71)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:619)

I have tried all possible combination for user name and password.
I have also tried password in encripted and non ecripted formate.

Please give your comments as early as possible.
It will realy help me.
I am trying to fix this problem since last 3 days but i am not able to find the solution.

Your comments will realy help me.

Thanks,
Jay.
jay b teraiya,修改在15 年前。

RE: PermissionChecker not initialized error while calling Liferay Web Servi

New Member 帖子: 12 加入日期: 08-12-5 最近的帖子
Hi All,

I am requesting to all member of this group.
Please give your comments as early as possible on this problem.

I am stuck because of this problem since last 4 days.

Please help me.

Thanks,
Jay.
klemensl l,修改在15 年前。

RE: PermissionChecker not initialized error while calling Liferay Web Servi

New Member 帖子: 2 加入日期: 09-1-12 最近的帖子
Hi,
same problem here. anyone knows how to solve this problem?
thx
klemensl l,修改在15 年前。

RE: PermissionChecker not initialized error while calling Liferay Web Servi

New Member 帖子: 2 加入日期: 09-1-12 最近的帖子
Hi,
i was able to solve the problem. i implemented my own permission checker and changed the liferay config to load it. now i dont get the exception any more. so try to implement your own permission or just create a dummy class to call the std. permission checker methods and change the liferay config.

lg klemensl
Sébastien Lagarrigue,修改在15 年前。

RE: PermissionChecker not initialized error while calling Liferay Web Servi

New Member 发布: 1 加入日期: 09-2-23 最近的帖子
Hi

I solve the problem using the secure Axis URL

http://<username>:<password>@localhost:8080/tunnel-web/secure/axis/Portlet_Journal_JournalArticleService

Sébastien