[JBoss Portal] - Re: Unable to Access a preference values from portlet-instan
by PeterJ
Here are the files.
I used JBoss AS 4.0.2.GA and Portal 2.6.0.
package com.portlet;
| import java.io.*;
| import javax.portlet.*;
| public class PlainRenderPortlet extends GenericPortlet {
| @Override
| protected void doView(RenderRequest request, RenderResponse response)
| throws PortletException,IOException {
| response.setContentType("text/html");
| PrintWriter writer = response.getWriter();
| try {
| String path = request.getPreferences().getValue("path", "**default**");
| writer.format("<h2>path=\"%s\"</h2>", path);
| } catch (Exception e) {
| e.printStackTrace();
| }
| }
| }
portlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
| <portlet-app
| version="1.0"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation=
| "http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| xmlns="http://java.sun.com/xml/ns/portlet"
| >
| <portlet>
| <description>CMS Render Portlet</description>
| <portlet-name>CMSRender</portlet-name>
| <display-name>CMS Render Portlet</display-name>
| <portlet-class>com.portlet.PlainRenderPortlet</portlet-class>
| <portlet-info>
| <title>CMS Render Title</title>
| </portlet-info>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| <portlet-mode>EDIT_CONTENT</portlet-mode>
| </supports>
| <portlet-preferences>
| <preference>
| <name>path</name>
| <value>/Company Home/highlights/sales.html</value>
| </preference>
| </portlet-preferences>
| </portlet>
| </portlet-app>
portlet-instances.xml:
<?xml version="1.0" standalone="yes"?>
| <!DOCTYPE deployments PUBLIC
| "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
| "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
| <deployments>
| <deployment>
| <instance>
| <instance-id>cmsrenderInstance</instance-id>
| <portlet-ref>CMSRender</portlet-ref>
| <preferences>
| <preference>
| <name>path</name>
| <value>/Company Home/highlights/Manager.tml</value>
| </preference>
| </preferences>
| </instance>
| </deployment>
| </deployments>
render-object.xml:
<?xml version="1.0" encoding="UTF-8" ?>
| <!DOCTYPE deployments PUBLIC
| "-//JBoss Portal//DTD Portal Object 2.6//EN"
| "http://www.jboss.org/portal/dtd/dtd/portal-object_2_6.dtd">
| <deployments>
| <deployment>
| <parent-ref>default</parent-ref>
| <if-exists>overwrite</if-exists>
| <instance>
| <instance-name>cmsrenderInstance</instance-name>
| <component-ref>CMSRenderer.CMSRender</component-ref>
| </instance>
| </deployment>
| <deployment>
| <parent-ref>default</parent-ref>
| <if-exists>overwrite</if-exists>
| <page>
| <page-name>CMSRenderPage</page-name>
| <window>
| <window-name>cmsrenderWindow</window-name>
| <instance-ref>cmsrenderInstance</instance-ref>
| <default>true</default>
| <region>center</region>
| <height>0</height>
| </window>
| </page>
| </deployment>
| </deployments>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
| <web-app
| xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
| http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
| version="2.4">
| </web-app>
jboss-app.xml:
<jboss-app>
| <app-name>render</app-name>
| </jboss-app>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069347#4069347
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069347
18Â years, 8Â months
[JBoss Seam] - Calling Identity.instance() from a servlet
by lmehret
Hi,
If I call Identity.instance() from a servlet or a filter I get the following IllegalStateException.
I assume I 've miss configured something... Any Ideas?
| java.lang.IllegalStateException: No active session context
| at org.jboss.seam.security.Identity.instance(Identity.java:106)
| at com.macrovision.postcard.view.download.DownloadForward.doGet(DownloadForward.java:44)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at com.macrovision.postcard.CustomerRecorderFilter.doFilter(CustomerRecorderFilter.java:78)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069335#4069335
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069335
18Â years, 8Â months
[JBoss Seam] - Conversation ID in web service response
by shakenbrain
I'm getting started with conversations in a JBoss Seam web service. I've got a basic web service with a method called 'start' that doesn't do anything (yet):
@Stateless
| @Name("supportCenterService")
| @WebService(name = "SupportCenter", targetNamespace = "http://blah.service", serviceName = "SupportCenterService")
| public class SupportCenter implements SupportCenterRemote {
|
| @In(create=true)
| AgentConfigurationSource agentConfiguration;
|
| @Logger
| Log log;
|
| @WebMethod
| public void start() {
| }
| }
|
I'm calling this web service from an Axis client generated from WSDL2Java:
public static void start() {
| try {
| SupportCenter supportCenter = SupportCenterClientFactory.getClient();
| supportCenter.start();
| SOAPHeaderElement[] headers = ((Stub) supportCenter).getResponseHeaders();
| System.out.println("Headers: " + headers.length);
| } catch (Exception e) {
| throw new WebServiceClientException(e);
| }
| }
The getClient method in SupportCenterClientFactory calls setMaintainSession:
public static SupportCenter getClient() {
| try {
| URL endpointAddress = new URL(AgentGlobals.getInstance().getConfig().getWebService().getPrimaryAddress());
| SupportCenterServiceLocator serviceLocator = new SupportCenterServiceLocator();
| serviceLocator.setMaintainSession(true);
| return serviceLocator.getSupportCenterPort(endpointAddress);
| } catch (ServiceException e) {
| throw new WebServiceClientException(e);
| } catch (MalformedURLException e) {
| throw new WebServiceClientException(e);
| }
| }
I have the following in META-INF/standard-jaxws-endpoint-config.xml:
<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:javaee="http://java.sun.com/xml/ns/javaee"
| xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
| <endpoint-config>
| <config-name>Seam WebService Endpoint</config-name>
| <pre-handler-chains>
| <javaee:handler-chain>
| <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
| <javaee:handler>
| <javaee:handler-name>SOAP Request Handler</javaee:handler-name>
| <javaee:handler-class>org.jboss.seam.webservice.SOAPRequestHandler</javaee:handler-class>
| </javaee:handler>
| </javaee:handler-chain>
| </pre-handler-chains>
| </endpoint-config>
| </jaxws-config>
So, going back to the client call, should I expect to see a conversation id in the response header? Right now, there are no headers defined in the response:
public static void start() {
| try {
| SupportCenter supportCenter = SupportCenterClientFactory.getClient();
| supportCenter.start();
| SOAPHeaderElement[] headers = ((Stub) supportCenter).getResponseHeaders();
| System.out.println("Headers: " + headers.length); // Result is 0
| } catch (Exception e) {
| throw new WebServiceClientException(e);
| }
| }
Am I misunderstanding something here, or am I missing something?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069332#4069332
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069332
18Â years, 8Â months