[JBoss Portal] - report portlet and ServletContext
by yxyang
Hi
I am trying to using eclipse BIRT report engine to implement my own ReportPortlet.
In the init() method of the portlet,
| public void init() {
| log.debug("init() is called");
| if (birtEngine == null) {
| EngineConfig config = new EngineConfig();
| log.debug("config="+config);
| IPlatformContext context = new PlatformServletContext(
| new JBossServletContextProvider().getServletContext(this));
| log.debug("context="+context);
| config.setPlatformContext(context);
| try {
| Platform.startup(config);
| } catch (BirtException e) {
| e.printStackTrace();
| }
| IReportEngineFactory factory = (IReportEngineFactory) Platform
| .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
| log.debug("factory="+factory);
| birtEngine = factory.createReportEngine(config);
| log.debug("birtEngine="+birtEngine);
| }
| }
|
ServetContext is accessed by using JBossServletContextProvider.
However, when i deploy the portlet, the following error happen:
anonymous wrote :
| Caused by: java.lang.IllegalStateException: No bridge set
| at org.jboss.portal.bridge.JBossServletContextProvider.getServletContext(JBossServletContextProvider.java:65)
| at com.ternary.wirelessthermometer.portlet.ReportPortlet.init(Unknown Source)
| at javax.portlet.GenericPortlet.init(GenericPortlet.java:355)
| at org.jboss.portal.portlet.PortletContainer.initPortlet(PortletContainer.java:368)
| at org.jboss.portal.portlet.PortletContainer.start(PortletContainer.java:229)
| ... 106 more
|
I went through the bridge related posts, and cannot find the solution.
(1)Do i need to configure the bridge interceptor myself? Or the default jboss portal 2.2.1 already configures the bridge interceptor for all portlet deployment?
(2)If need myself to configure, how to? Which configure file need to be configured?
Thanks
yang
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969098#3969098
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969098
19 years, 7 months
[EJB 3.0] - a unidirectonal one-to many example, anyone can help me?
by killme2008
I wrote a example following the <mastringEJB4th>.
1.First,a company.java file:
@Entity
public class Company implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
private String name;
private Set employees;
public Company() {
}
@OneToMany(cascade = CascadeType.PERSIST, fetch=FetchType.EAGER,mappedBy="company")
public Set getEmployees() {
return employees;
}
public void setEmployees(Set employees) {
this.employees = employees;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
2.And then ,Employee.java:
@Entity()
public class Employee implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
private String name;
private char sex;
public Employee() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public char getSex() {
return sex;
}
public void setSex(char sex) {
this.sex = sex;
}
}
3.I wrote a SLSB to test the example:
......
Company company = new Company();
Set employees = new HashSet();
Employee employee = new Employee();
employee.setName("jordan");
employee.setSex('M');
employees.add(employee);
employee = new Employee();
employee.setName("dennis");
employee.setSex('M');
employees.add(employee);
employee = new Employee();
employee.setName("catty");
employee.setSex('F');
employees.add(employee);
employee = new Employee();
employee.setName("inter");
employee.setSex('F');
employees.add(employee);
employee = new Employee();
employee.setName("James Gosling");
employee.setSex('M');
employees.add(employee);
company.setEmployees(employees);
em.persist(company);
}
public List getCompanies() {
Query query = em.createQuery("SELECT c FROM Company c");
return query.getResultList();
}
..........
but when I tried to deploy the example to the JBoss Server,it goes wrong:
Could not determine type for: java.util.Set, for columns: [org.hibernate.mapping.Column(employees)]
I don't know why!!!Is my code have any problems?anyone can help me?thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969097#3969097
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969097
19 years, 7 months
[JBoss Portal] - Re: Problems with StrutsBridge
by yxyang
"alessandroribeiro" wrote : Hi,
|
| this is the demo's jboss-portlet.xml:
|
| <portlet-app>
|
| <portlet-name>StrutsHelloPortlet</portlet-name>
| <!-- Use the specific struts container configuration -->
| <config-name>StrutsHelloPortlet</config-name>
|
| </portlet-app>
|
|
| I had tried both with and without <config-name> to no avail. I tried to insert this line again in the file, but there is still this "no bridge set" error. And there is also a new error:
|
| 21:15:23,703 ERROR [PortletAppDeployment] No config for the name StrutsHelloPortlet will use the default configuration
|
| What exactly is this <config-name> used for ?
|
Hello,
I want to get the ServletContext from portlet for some special reason. I am trying to use eclipse BIRT report engine in my ReportPortlet.
But the BIRT report engine API need to access ServletContext. I went through the posts, and find the bridge is a way to get the ServletContext.
But when i deploy my portlet and its init() method through the following exception
anonymous wrote :
| Caused by: java.lang.IllegalStateException: No bridge set
| at org.jboss.portal.bridge.JBossServletContextProvider.getServletContext(JBossServletContextProvider.java:65)
| at com.ternary.wirelessthermometer.portlet.ReportPortlet.init(Unknown Source)
| at javax.portlet.GenericPortlet.init(GenericPortlet.java:355)
| at org.jboss.portal.portlet.PortletContainer.initPortlet(PortletContainer.java:368)
| at org.jboss.portal.portlet.PortletContainer.start(PortletContainer.java:229)
|
I am using jbp2.2.1 on AS4.0.3SP1.
In addition, what is the <config-name>StrutsHelloPortlet</config-name>
for?
yang
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969096#3969096
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969096
19 years, 7 months
[JBoss Seam] - LazyInitializationException and caching
by mrohad
Hello all!
Code is Entity bean.
and I am caching all Codes using static HashMap..
when I am trying to retieve list of Code and sending the result to my register.jsp i am getting the following exception...
any idea way?
I would like to keep them deattached and I wonder if I can bring all their properties in a non-lazy way?
it seem like there is a problem with the .toString method...
I will be thankfull for any assistance you can provide
| 16:54:18,676 ERROR [LazyInitializationException] could not initialize proxy - the owning Session was closed
| org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed
| at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:60)
| at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
| at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:196)
| at com.wannabet.ejb.entities.Code_$$_javassist_45.toString(Code_$$_javassist_45.java)
| at com.sun.facelets.util.DevTools.writeAttributes(DevTools.java:255)
| at com.sun.facelets.util.DevTools.writeStart(DevTools.java:284)
| at com.sun.facelets.util.DevTools.writeComponent(DevTools.java:189)
| at com.sun.facelets.util.DevTools.writeComponent(DevTools.java:207)
| at com.sun.facelets.util.DevTools.writeComponent(DevTools.java:207)
| at com.sun.facelets.util.DevTools.writeComponent(DevTools.java:207)
| at com.sun.facelets.util.DevTools.debugHtml(DevTools.java:133)
| at com.sun.facelets.tag.ui.UIDebug.writeDebugOutput(UIDebug.java:92)
| at com.sun.facelets.tag.ui.UIDebug.encodeBegin(UIDebug.java:81)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
| at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
| at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:65)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:226)
| 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.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=3969093#3969093
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969093
19 years, 7 months