Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hey folks. I've run across this problem before but it's come up again in an interesting place. In the past I've seen this error coming from a JSP where I used Java within the JSP to call out to a webject. This is the solution that I used for this issue before:
<jsp:usebean id="wtcontext" class="wt.httpgw.WTContextBean" scope="request"/">
<jsp:usebean id="loginBean" class="com.ptc.netmarkets.util.beans.NmLoginBean" scope="session"/"><%
// later in JSP
wtcontext.setRequest(request);
loginBean.setRemoteUser(request.getRemoteUser());
%>
However, now I am seeing this issue in a servlet which I am calling via Ajax from a browser connected to our Windchill instance. I've tried adding this to the top of my doGet() method in the servlet but it doesn't help:
WTContextBean wtcontext = (WTContextBean) request.getAttribute("wtcontext");
if(wtcontext == null) {
wtcontext = new WTContextBean();
}NmLoginBean loginBean = (NmLoginBean) request.getSession(true).getAttribute("loginBean");
if(loginBean == null) {
loginBean = new NmLoginBean();
}wtcontext.setRequest(request);
try { loginBean.setRemoteUser(request.getRemoteUser()); }
catch (WTException e1) {
e1.printStackTrace();
throw new ServletException(e1);
}
Does anyone have any other advice how to correct or work around this issue? Thanks for your time!
-Thomas R. Busch
Here is the relevent part of the stack trace for the error:
wt.util.WTRuntimeException: The operation: "refresh" failed.
Nested exception is: wt.util.WTRemoteException: Unable to invoke remote method
Nested exception is: wt.method.AuthenticationException; nested exception is:
(wt.fc.fcResource/0) wt.util.WTException: The operation: "refresh" failed.
Nested exception is: wt.util.WTRemoteException: Unable to invoke remote method; nested exception is:
wt.method.AuthenticationException
wt.fc.ObjectReference.getObject(ObjectReference.java:750)
com.infoengine.compiledTasks.file.d$3a.ptc.Windchill.tasks.stryker.getlatestpart$2exml.invoke(getlatestpart$2exml.java:67)
com.infoengine.SAK.Task.invoke(Task.java:1718)
-Thomas R. Busch