cancel
Showing results for 
Search instead for 
Did you mean: 

Running on a different port?

martinbradford
Champ in-the-making
Champ in-the-making
Hi there,

I've been coding a simple application against the web service API on Alfresco 1.4 preview under JBoss 4. At this stage, it just starts a session, then inserts a document and closes the session. It's running on the same machine as the Alfresco server and it all came up and worked fine from the start without any configuration, but I then decided that I wanted to switch tomcat to port 80.

I reconfigured JBoss to start Tomcat on port 80 and created the webserviceclient.properties file specifying the server as http://localhost:80

But when I run my previously working code, I get the following exception trace :

14:45:02,591 INFO  [STDOUT] Exception!Error starting session.
14:45:02,599 INFO  [STDOUT] org.alfresco.webservice.util.WebServiceException: Error starting session.
14:45:02,601 INFO  [STDOUT]     at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:85)
14:45:02,601 INFO  [STDOUT]     at uk.co.abcomputing.AlfrescoBean.insert(AlfrescoBean.java:38)
14:45:02,601 INFO  [STDOUT]     at org.apache.jsp.upload_005fand_005findex_jsp._jspService(org.apache.jsp.upload_005fand_005findex_jsp:62)
14:45:02,602 INFO  [STDOUT]     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
14:45:02,602 INFO  [STDOUT]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
14:45:02,602 INFO  [STDOUT]     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
14:45:02,603 INFO  [STDOUT]     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
14:45:02,603 INFO  [STDOUT]     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
14:45:02,603 INFO  [STDOUT]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
14:45:02,604 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
14:45:02,604 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
14:45:02,604 INFO  [STDOUT]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
14:45:02,604 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
14:45:02,605 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
14:45:02,605 INFO  [STDOUT]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
14:45:02,605 INFO  [STDOUT]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
14:45:02,606 INFO  [STDOUT]     at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
14:45:02,606 INFO  [STDOUT]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
14:45:02,606 INFO  [STDOUT]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
14:45:02,607 INFO  [STDOUT]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
14:45:02,607 INFO  [STDOUT]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
14:45:02,607 INFO  [STDOUT]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
14:45:02,608 INFO  [STDOUT]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
14:45:02,608 INFO  [STDOUT]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
14:45:02,608 INFO  [STDOUT]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
14:45:02,609 INFO  [STDOUT]     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
14:45:02,609 INFO  [STDOUT]     at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
14:45:02,609 INFO  [STDOUT]     at java.lang.Thread.run()V(Unknown Source)
14:45:02,621 INFO  [STDOUT] Caused by: (404)/AuthenticationService
14:45:02,621 INFO  [STDOUT]     at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
14:45:02,621 INFO  [STDOUT]     at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
14:45:02,621 INFO  [STDOUT]     at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
14:45:02,622 INFO  [STDOUT]     at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
14:45:02,622 INFO  [STDOUT]     at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
14:45:02,622 INFO  [STDOUT]     at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
14:45:02,623 INFO  [STDOUT]     at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
14:45:02,623 INFO  [STDOUT]     at org.apache.axis.client.Call.invoke(Call.java:2767)
14:45:02,623 INFO  [STDOUT]     at org.apache.axis.client.Call.invoke(Call.java:2443)
14:45:02,624 INFO  [STDOUT]     at org.apache.axis.client.Call.invoke(Call.java:2366)
14:45:02,624 INFO  [STDOUT]     at org.apache.axis.client.Call.invoke(Call.java:1812)
14:45:02,624 INFO  [STDOUT]     at org.alfresco.webservice.authentication.AuthenticationServiceSoapBindingStub.startSession(AuthenticationServiceSoapBindingStub.java:187)
14:45:02,625 INFO  [STDOUT]     at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:70)
14:45:02,625 INFO  [STDOUT]     at uk.co.abcomputing.AlfrescoBean.insert(AlfrescoBean.java:38)
14:45:02,626 INFO  [STDOUT]     at org.apache.jsp.upload_005fand_005findex_jsp._jspService(org.apache.jsp.upload_005fand_005findex_jsp:62)
14:45:02,626 INFO  [STDOUT]     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
14:45:02,626 INFO  [STDOUT]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
14:45:02,627 INFO  [STDOUT]     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
14:45:02,627 INFO  [STDOUT]     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
14:45:02,627 INFO  [STDOUT]     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
14:45:02,627 INFO  [STDOUT]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
14:45:02,628 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
14:45:02,628 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
14:45:02,629 INFO  [STDOUT]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


- it seems to be unable to find the AuthenticationService. I then put Tomcat back on port 8080 and edited the webserviceclient.properties file, but still got the same error - it only worked again after I completely removed the properties file…

Any suggestions? For the time being, I have gone back to forwarding the traffic through Apache into Tomcat, but that does not seem to work well with JBoss Portal which I think I need…

Martin Bradford
2 REPLIES 2

fchevance
Champ in-the-making
Champ in-the-making
Hi,

Try checking these 2 things:

1 - your  webserviceclient.properties is located in alfresco folder (not in alfresco/extension)

2 - in this file, check it looks like:

repository.location=http://host:port/alfresco/api
(add "alfresco/api" to your current config if missing, someone already posted this issue)

martinbradford
Champ in-the-making
Champ in-the-making
Hi,

Try checking these 2 things:

1 - your  webserviceclient.properties is located in alfresco folder (not in alfresco/extension)

2 - in this file, check it looks like:

repository.location=http://host:port/alfresco/api
(add "alfresco/api" to your current config if missing, someone already posted this issue)

Thanks for that - it looks like it is the solution. I don't remember deleting the "alfresco/api" from the end - did the original sample file go out with it missing? I've now lost track of where I got it from.

For the potential benefit of others, I discovered that this also solves another problem - I was writing a JSP page which allowed the user to upload and insert a document into the Alfresco repository. The code then picked up the URL of the inserted document and stored it in a database for subsequent retrieval. The problem which I had was that without explicitly setting the repository location, the URLs always came back relative to "localhost" - no use at all if I am subsequently going to reference them from another machine. By overriding the repository location to be the full name of the Alfresco server, the URL returned from the web service is now a fully qualified absolute path.

Many thanks,

Martin