Clicky

I have created a Java client which calls a custom DFS service.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
public class ClientGetResume {
    
    private static String ehrsModuleName = "ehrs";
    private static String host = "http://localhost:8888/services";
    
    public static void main(String[] args) {
        
        ContextFactory contextFactory = ContextFactory.getInstance();
        IServiceContext serviceContext = contextFactory.newContext();
        RepositoryIdentity repoId = new RepositoryIdentity();
        repoId.setRepositoryName("test123");
        repoId.setUserName("Administrator");
        repoId.setPassword("Hello123");
        serviceContext.addIdentity(repoId);;
        ServiceFactory serviceFactory = ServiceFactory.getInstance();
        IEHRS ehrsSvc = null;
        try {
            ehrsSvc = serviceFactory.getRemoteService(IEHRS.class, 
                             serviceContext, ehrsModuleName, host);
            
            String empName = ehrsSvc.getEmployeeName("1"); 
        }catch(ServiceInvocationException sie) {
            sie.printStackTrace();
        }catch(ServiceException se) {
            se.printStackTrace();
        }
    }

Then I run this client, I get the following error
1:
com.emc.documentum.fs.rt.AuthenticationException: Authorization failed, please review identities provided in service context "temporary/127.0.0.1-1289576056736-8988088621673498558"

I have verified that the credentails are correct and also dfc.properties is in classpath. I can otherwise access the service from browser at
1:
http://localhost:8888/services/ehrs/EHRS

Is there something that I am doing incorrectly in the client that I have written?

Thank you

asked 11/15/2010 01:39

ank5's gravatar image

ank5 ♦♦


5 Answers:
Also, if I call this web service using soapUI by passing the SOAP request directly it works absolutely. Here is the SOAP request I am passing in soapUI

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ehrs="http://www.mycompany.org/EHRS/">

   <soapenv:Header>
      <ServiceContext xmlns="http://context.core.datamodel.fs.documentum.emc.com/" xmlns:ns2="http://properties.core.datamodel.fs.documentum.emc.com/" xmlns:ns3="http://profiles.core.datamodel.fs.documentum.emc.com/">
       <Identities password="Hello123" 
          repositoryName="test123" 
       userName="Administrator" 
        xsi:type="RepositoryIdentity" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
      </ServiceContext>
   </soapenv:Header>

   <soapenv:Body>
      <ehrs:GetEmployeeName>
         <empID>2</empID>
      </ehrs:GetEmployeeName>
   </soapenv:Body>
</soapenv:Envelope>
link
ank5's gravatar image

ank5

Here is the complete stack trace

 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
22:03:42,127 DEBUG [DFS] com.emc.documentum.fs.rt.context.impl.ClientReflectionServiceInvoker - assignProperties: can't find setter for getClass
com.emc.documentum.fs.rt.AuthenticationException: Authorization failed, please review identities provided in service context temporary/127.0.0.1-1289579611408-1305564370477894500
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.authenticate(AuthorizationHandler.java:119)
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.handleMessage(AuthorizationHandler.java:63)
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.handleMessage(AuthorizationHandler.java:1)
    at com.sun.xml.ws.handler.HandlerProcessor.callHandleMessage(HandlerProcessor.java:284)
    at com.sun.xml.ws.handler.HandlerProcessor.callHandlersRequest(HandlerProcessor.java:135)
    at com.sun.xml.ws.handler.ServerSOAPHandlerTube.callHandlersOnRequest(ServerSOAPHandlerTube.java:133)
    at com.sun.xml.ws.handler.HandlerTube.processRequest(HandlerTube.java:116)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
    at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:595)
    at local.stacktrace(0:0)
    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:585)
    at com.emc.documentum.fs.rt.context.impl.ClientReflectionServiceInvoker.invoke(ClientReflectionServiceInvoker.java:78)
    at com.emc.documentum.fs.rt.context.impl.SoapClientInvocationHandler.invoke(SoapClientInvocationHandler.java:66)
    at com.emc.documentum.fs.rt.context.impl.UcfClientInvocationHandler.invoke(UcfClientInvocationHandler.java:47)
    at com.emc.documentum.fs.rt.context.impl.HttpSessionInvocationHandler.invoke(HttpSessionInvocationHandler.java:65)
    at com.emc.documentum.fs.rt.context.impl.ReturnedContentTransformationHandler.invoke(ReturnedContentTransformationHandler.java:45)
    at com.emc.documentum.fs.rt.context.impl.OperationOptionsHandler.invoke(OperationOptionsHandler.java:59)
    at com.emc.documentum.fs.rt.context.impl.ContextThreadLocalInvocationHandler.invoke(ContextThreadLocalInvocationHandler.java:51)
    at com.emc.documentum.fs.rt.context.impl.ServiceContextInvocationHandler.invoke(ServiceContextInvocationHandler.java:30)
    at $Proxy14.getEmployeeName(Unknown Source)
    at com.db.client.prodlayer.ClientGetResume.main(ClientGetResume.java:32)
Caused by: java.lang.NoClassDefFoundError
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory$SessionManagerWrapper.newClient(SessionManagerFactory.java:171)
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory$SessionManagerWrapper.getClient(SessionManagerFactory.java:161)
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory$SessionManagerWrapper.newManager(SessionManagerFactory.java:105)
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory$SessionManagerWrapper.getManager(SessionManagerFactory.java:96)
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory.getSessionManager(SessionManagerFactory.java:60)
    at com.emc.documentum.fs.rt.context.impl.SessionHandlerUtil.getManager(SessionHandlerUtil.java:37)
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.authenticate(AuthorizationHandler.java:84)
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.handleMessage(AuthorizationHandler.java:63)
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.handleMessage(AuthorizationHandler.java:1)
    at com.sun.xml.ws.handler.HandlerProcessor.callHandleMessage(HandlerProcessor.java:284)
    at com.sun.xml.ws.handler.HandlerProcessor.callHandlersRequest(HandlerProcessor.java:135)
    at com.sun.xml.ws.handler.ServerSOAPHandlerTube.callHandlersOnRequest(ServerSOAPHandlerTube.java:133)
    at com.sun.xml.ws.handler.HandlerTube.processRequest(HandlerTube.java:116)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
    at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:595)
link
ank5's gravatar image

ank5

Caused by: java.lang.NoClassDefFoundError
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory$SessionManagerWrapper.newClient(SessionManagerFactory.java:171)


that looks like the real cause.  It can't find a dependant class
link
objects's gravatar image

objects

so make sure you have all dependant jars in your classpath
link
objects's gravatar image

objects

It could not find the dfc.properties as it was not in the ear.

Thanks for the help
link
ank5's gravatar image

ank5

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 11/15/2010 01:39

Seen: 841 times

Last updated: 11/16/2010 10:45