cancel
Showing results for 
Search instead for 
Did you mean: 

AuthenticationUtils.startSession() does not work in JSP pag

chengdong
Champ in-the-making
Champ in-the-making
Hi
I am trying to get a ticket by calling  AuthenticationUtils.startSession(). It does not work in JSP.  it works in standalone java class. Did I miss anything in the jar file, certificate or classpath?

Thanks for help



   try {
         WebServiceFactory.setEndpointAddress("https://cms-dev.vbi.vt.edu/alfresco/api");
          AuthenticationUtils.startSession("admin", "admin");
         String ticket = AuthenticationUtils.getTicket();
         return ticket;

      } catch (Exception serviceException) {
         throw new RuntimeException("Problem invoking web script",
               serviceException);
      }
      finally {           
       // End the session
       AuthenticationUtils.endSession();
       if (conn != null) conn.disconnect();
       }
   }%>
5 REPLIES 5

lourdes
Champ in-the-making
Champ in-the-making
Hello,

I have the same problem.

When i trie to use:
WebServiceFactory.setEndpointAddress("http://localhost:8080/alfresco/api");

then:

05-abr-2010 10:08:00 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() para servlet generaPDF lanzó excepción
javax.servlet.ServletException: La ejecución del Servlet lanzó una excepción
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Unknown Source)

hadabechir
Champ in-the-making
Champ in-the-making
Hi, i have the same problem, so please can you post the solution  if you find it  :wink:

mangar
Star Contributor
Star Contributor
I was having this problem too. My solution, though ugly, seems to work.  Go to the alfresco SDK and in the remote/dependencies folder you will find all the jars you need (also the alfresco-web-service-client-3.3.jar). Just place them in your WEB-INF/lib directory and restart.

2 things:

  1. This should not be. the tomcat/lib directory should be fine. but it clearly is not. But I do not know if this is a tomcat or alfresco problem.
  2. There also seems to be a lock on the alfresco-web-service-client-3.3.jar once run. This prevents me from re-deploying my WAR properly. I must stop tomcat copy my war and restart. VERY annoying.

Hope this helps

hadabechir
Champ in-the-making
Champ in-the-making
I did the steps that you posted mangar, but i'm still having the same problem  :x

mangar
Star Contributor
Star Contributor
Well, I don't know what I did, but I upgraded everything to 3.3 (I just thought I did before) and I got new errors. However, after many days of pulling my hair out, I have found a solution.

This now works for me:

1 upgrade everything to 3.3 and 3.3 SDK
2. upgrade your Axis2 to 1.5.1 and use it build your .arr (Web service only)
3. your alfresco-core-3.3.jar and alfresco-web-service-client-3.3.jar should be in tomcat/lib
4. there needs to be NO JARS in your webapp/WEB-INF/lib directory
5. Any ClassNotFound errors should be fixed by placing the jars in /lib/remote/dependencies in tomcat/lib

this also fixed my problem of having to restart alfresco every time i redeploy my war file!

I am in a happy place now. (see how long that lasts!)