AnsweredAssumed Answered

Java Webscript exposed as a portlet on JBoss Portal [SOLVED]

Question asked by openpj Moderator on Sep 1, 2008
Latest reply on Sep 1, 2008 by openpj
I have a problem when I try to deploy a Java Backed Web Script developed on Alfresco ECM 2.2 on JBoss Portal as a portlet instance.
On Alfresco web client this web script works correctly, and all the others webscripts implemented as FTL template works correctly as portlet instance on JBoss.
FTL templates are imported using Alfresco web client.
Java Backed webscript is deployed in Alfresco package copying all the files in their correct paths.

I create the new instance of the portlet but when I try to run this Java Backed portlet instance on JBoss return this error message:


The Web Script /alfresco/168s/customer/newsearch has responded with a status of 500 - Internal Error.

500 Description:   An error inside the HTTP server which prevented it from fulfilling the request.

Message:   No content type defined

Exception:   java.lang.IllegalStateException - No content type defined
   
   org.jboss.portal.portlet.invocation.response.FragmentResponse.getWriter(FragmentResponse.java:185)
   org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl.getWriter(RenderResponseImpl.java:118)
   org.alfresco.web.scripts.portlet.WebScriptPortletResponse.getWriter(WebScriptPortletResponse.java:129)
   customer.alfresco.module.newsearch.NewAdvancedSearch.execute(NewAdvancedSearch.java:93)
   org.alfresco.web.scripts.WebScriptRuntime.wrappedExecute(WebScriptRuntime.java:364)
   org.alfresco.web.scripts.WebScriptRuntime$1.execute(WebScriptRuntime.java:330)
   org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:241)
   org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:171)
   org.alfresco.web.scripts.WebScriptRuntime.transactionedExecute(WebScriptRuntime.java:341)
   org.alfresco.web.scripts.WebScriptRuntime.authenticatedExecute(WebScriptRuntime.java:284)
   org.alfresco.web.scripts.WebScriptRuntime.executeScript(WebScriptRuntime.java:150)
   org.alfresco.web.scripts.portlet.WebScriptPortlet.doView(WebScriptPortlet.java:219)
   org.alfresco.web.scripts.portlet.WebScriptPortlet.render(WebScriptPortlet.java:136)
   org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.invokeRender(PortletContainerImpl.java:483)
   org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.dispatch(PortletContainerImpl.java:405)
   org.jboss.portal.portlet.container.PortletContainerInvoker$1.invoke(PortletContainerInvoker.java:86)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
   org.jboss.portal.core.aspects.portlet.TransactionInterceptor.org$jboss$portal$core$aspects$portlet$TransactionInterceptor$invokeNotSupported$aop(TransactionInterceptor.java:86)
   org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
   org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
   org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:112)
   org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
   org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
   org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:102)
   org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
   org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invokeNotSupported(TransactionInterceptor.java)
   org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invoke(TransactionInterceptor.java:56)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.portlet.HeaderInterceptor.invoke(HeaderInterceptor.java:50)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor.invoke(ProducerCacheInterceptor.java:58)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.portlet.AjaxInterceptor.invoke(AjaxInterceptor.java:51)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.aspects.portlet.ModesInterceptor.invoke(ModesInterceptor.java:62)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.bridge.BridgeInterceptor.invoke(BridgeInterceptor.java:47)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.aspects.portlet.WindowStatesInterceptor.invoke(WindowStatesInterceptor.java:55)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.aspects.portlet.PortletSessionSynchronizationInterceptor.invoke(PortletSessionSynchronizationInterceptor.java:80)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.aspects.portlet.ContextTrackerInterceptor.invoke(ContextTrackerInterceptor.java:46)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor$1.doCallback(ContextDispatcherInterceptor.java:104)
   org.jboss.portal.web.command.CommandDispatcher$CallbackCommand.execute(CommandDispatcher.java:74)
   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:585)
   org.jboss.portal.web.command.CommandServlet.doGet(CommandServlet.java:131)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
   org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
   org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
   org.jboss.portal.web.command.CommandServlet.include(CommandServlet.java:80)
   org.jboss.portal.web.command.CommandDispatcher.include(CommandDispatcher.java:50)
   org.jboss.portal.web.jboss.JBossWebContext.include(JBossWebContext.java:66)
   org.jboss.portal.web.ServletContainer.include(ServletContainer.java:182)
   org.jboss.portal.portlet.impl.spi.AbstractRequestContext.dispatch(AbstractRequestContext.java:81)
   org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:76)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:68)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.aspects.portlet.ValveInterceptor.invoke(ValveInterceptor.java:60)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
   org.jboss.portal.portlet.container.PortletContainerInvoker.invoke(PortletContainerInvoker.java:198)
   org.jboss.portal.portlet.state.producer.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java:233)
   org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker.org$jboss$portal$core$impl$portlet$state$ProducerPortletInvoker$invoke$aop(ProducerPortletInvoker.java:53)
   org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
   org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
   org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
   org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
   org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
   org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
   org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
   org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java)
   org.jboss.portal.portlet.federation.impl.FederatedPortletInvokerService.invoke(FederatedPortletInvokerService.java:147)
   org.jboss.portal.portlet.federation.impl.FederatingPortletInvokerService.invoke(FederatingPortletInvokerService.java:150)
   org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$1.invoke(InstanceContainerImpl.java:99)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
   org.jboss.portal.portlet.management.PortletContainerManagementInterceptorImpl.invoke(PortletContainerManagementInterceptorImpl.java:58)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.aspects.portlet.PortalSessionSynchronizationInterceptor.invoke(PortalSessionSynchronizationInterceptor.java:91)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.model.instance.InstanceSecurityInterceptor.invoke(InstanceSecurityInterceptor.java:91)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor.invoke(ConsumerCacheInterceptor.java:134)
   org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
   org.jboss.portal.core.impl.model.instance.InstanceContainerImpl.org$jboss$portal$core$impl$model$instance$InstanceContainerImpl$invoke$aop(InstanceContainerImpl.java:427)
   org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
   org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
   org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
   org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
   org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
   org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
   org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
   org.jboss.portal.core.impl.model.instance.InstanceContainerImpl.invoke(InstanceContainerImpl.java)
   org.jboss.portal.core.impl.model.instance.AbstractInstance.invoke(AbstractInstance.java:231)
   org.jboss.portal.core.impl.model.content.InternalContentProvider.renderWindow(InternalContentProvider.java:265)
   org.jboss.portal.core.model.portal.command.render.RenderWindowCommand.execute(RenderWindowCommand.java:92)
   org.jboss.portal.core.controller.ControllerCommand$1.invoke(ControllerCommand.java:68)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
   org.jboss.portal.core.aspects.controller.node.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:123)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.ControlInterceptor.invoke(ControlInterceptor.java:56)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.invoke(PageCustomizerInterceptor.java:133)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:78)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:81)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.NavigationalStateInterceptor.invoke(NavigationalStateInterceptor.java:42)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.controller.ajax.AjaxInterceptor.invoke(AjaxInterceptor.java:56)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.ResourceAcquisitionInterceptor.invoke(ResourceAcquisitionInterceptor.java:50)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
   org.jboss.portal.core.controller.ControllerContext.execute(ControllerContext.java:134)
   org.jboss.portal.core.model.portal.command.render.RenderWindowCommand.render(RenderWindowCommand.java:72)
   org.jboss.portal.core.model.portal.command.render.RenderPageCommand.execute(RenderPageCommand.java:218)
   org.jboss.portal.core.controller.ControllerCommand$1.invoke(ControllerCommand.java:68)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
   org.jboss.portal.core.aspects.controller.node.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:123)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.ControlInterceptor.invoke(ControlInterceptor.java:56)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.invoke(PageCustomizerInterceptor.java:133)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:78)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:81)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.NavigationalStateInterceptor.invoke(NavigationalStateInterceptor.java:42)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.controller.ajax.AjaxInterceptor.invoke(AjaxInterceptor.java:56)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.controller.ResourceAcquisitionInterceptor.invoke(ResourceAcquisitionInterceptor.java:50)
   org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
   org.jboss.portal.core.controller.ControllerContext.execute(ControllerContext.java:134)
   org.jboss.portal.core.model.portal.PortalObjectResponseHandler.processCommandResponse(PortalObjectResponseHandler.java:74)
   org.jboss.portal.core.controller.classic.ClassicResponseHandler.processHandlers(ClassicResponseHandler.java:79)
   org.jboss.portal.core.controller.classic.ClassicResponseHandler.processCommandResponse(ClassicResponseHandler.java:53)
   org.jboss.portal.core.controller.handler.ResponseHandlerSelector.processCommandResponse(ResponseHandlerSelector.java:70)
   org.jboss.portal.core.controller.Controller.processCommandResponse(Controller.java:271)
   org.jboss.portal.core.controller.Controller.processCommand(Controller.java:259)
   org.jboss.portal.core.controller.Controller.handle(Controller.java:217)
   org.jboss.portal.server.RequestControllerDispatcher.invoke(RequestControllerDispatcher.java:51)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
   org.jboss.portal.core.cms.aspect.IdentityBindingInterceptor.invoke(IdentityBindingInterceptor.java:47)
   org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:68)
   org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.server.PortalContextPathInterceptor.invoke(PortalContextPathInterceptor.java:45)
   org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:96)
   org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:246)
   org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.server.aspects.server.SignOutInterceptor.invoke(SignOutInterceptor.java:98)
   org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.impl.api.user.UserEventBridgeTriggerInterceptor.invoke(UserEventBridgeTriggerInterceptor.java:65)
   org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.core.aspects.server.TransactionInterceptor.org$jboss$portal$core$aspects$server$TransactionInterceptor$invoke$aop(TransactionInterceptor.java:49)
   org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
   org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
   org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:253)
   org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
   org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
   org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:262)
   org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
   org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
   org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.server.aspects.LockInterceptor$InternalLock.invoke(LockInterceptor.java:69)
   org.jboss.portal.server.aspects.LockInterceptor.invoke(LockInterceptor.java:130)
   org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
   org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
   org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:250)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
   org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
   org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
   java.lang.Thread.run(Thread.java:613)

Here you are the snippets:

I think that I must define the content type from the WebScript Java class but I don't know how, now I tried to set the content type in this way, but don't works:


            Writer writer = res.getWriter();
            res.setContentType(WebScriptResponse.HTML_FORMAT);
            renderTemplate(FORM_TEMPLATE_FTL_PATH,model,writer);

Alfresco portlet.xml:

<portlet>
   <description>New Search Java Backed Web Script</description>
   <portlet-name>AdvancedSearchPortletJava</portlet-name>
   <portlet-class>org.alfresco.web.scripts.portlet.WebScriptPortlet</portlet-class>

   <init-param>
      <name>authenticator</name>
      <value>webscripts.authenticator.jsr168.webclient</value>
   </init-param>

   <init-param>
      <name>scriptUrl</name>
      <value>/alfresco/168s/customer/newsearch</value>
   </init-param>
   <supported-locale>it</supported-locale>
   <expiration-cache>0</expiration-cache>
   <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
   </supports>
   <portlet-info>
      <title>Advanced Search</title>
      <short-title>Advanced Search</short-title>
   </portlet-info>
</portlet>


Java Backed WebScript:

public class NewAdvancedSearch extends AbstractWebScript{
   
   private Log log = LogFactory.getLog(NewAdvancedSearch.class);
   private static final String USER_HOME_ATTRIBUTE_NAME = "userhome";
   private static final String COMPANY_HOME_ATTRIBUTE_NAME = "companyhome";
   private static final String QUERY_LIST_LUCENE = "PATH:\"/app:company_home/*\"";
   private static final String FORM_TEMPLATE_FTL_PATH = "customer/newsearch/newsearch.get.html.ftl";
   
        public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
           
            WebScriptContext repository = getRepositoryContext();
            SearchParameters sp = new SearchParameters();
            ServiceRegistry serviceRegistry = getServiceRegistry();
            NodeService nodeService = serviceRegistry.getNodeService();
            sp.setLanguage(SearchService.LANGUAGE_LUCENE);
            sp.setQuery(QUERY_LIST_LUCENE);
            sp.addStore(Repository.getStoreRef());
           
            ResultSet results = null;
            List<Amm> list = new ArrayList<Amm>();
            try
            {
                results = serviceRegistry.getSearchService().query(sp);
            
                for(ResultSetRow row : results){
                    NodeRef currentNodeRef = row.getNodeRef();
                    String name = nodeService.getProperty(currentNodeRef, ContentModel.PROP_NAME).toString();
                    ………
                }
            }
            finally
            {
                if(results != null)
                {
                    results.close();
                }
            }

           
            Map<String, Object> model = new HashMap<String, Object>();
            model.put(USER_HOME_ATTRIBUTE_NAME, repository.getUserHome(repository.getPerson()));
            model.put(COMPANY_HOME_ATTRIBUTE_NAME,repository.getCompanyHome());
            model.put(LIST_ATTRIBUTE_NAME, list);
            Writer writer = res.getWriter();
            res.setContentType(WebScriptResponse.HTML_FORMAT);
            renderTemplate(FORM_TEMPLATE_FTL_PATH,model,writer);
           
        }
       
       
}

I follow the deploy settings on this thread:
http://forums.alfresco.com/en/viewtopic.php?f=36&t=13175

Have you got some ideas to solve this problem?
Thank you very much for your support.

Outcomes