[JBoss Portal] - Header content injection programatically
by mvera
Hi everybody,
I use JBossPortal 2.4.0 bundled.
I have problems to set header content programatically. I need to do it this way as my css is dynamically set for each user.
So I tried to use this way I found on this site :
rr.addProperty("HEADER_CONTENT", _htmlBuff.toString())
My debugger says me the code is executed and the content is the one I want,
...
This code is executed inside a JSP tag from mine, I managed to get a render response inside the tag.
But I still have an empty header content :
<!-- insert header content that was possibly set by portlets on the page -->
I also read on this forum that I had to use a tag :
<JBoss Portal 2.2 early
<meta http-equiv="Content-Type" content="text/html;" />
<p:headerContent />
I don't understand why this example includes a header in its html fragment as I did everything to avoid any or tag in the html generated by my portlet ?
What is the solution ?
Thanks for reading my question.
Mickaël
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982744#3982744
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982744
19Â years, 6Â months
[Persistence, JBoss/CMP, Hibernate, Database] - Persistence context dependency declaration vs. datasource co
by kaja78
Hi, I am using JBOSS 4.0.4.GA. My persistence.xml file looks like this:
<persistence>
| <persistence-unit name="org.bf.persistence">
| <jta-data-source>java:/org.bf.DS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto"
| value="update"/>
| <property name="hibernate.dialect"
| value="org.hibernate.dialect.OracleDialect"/>
| <property name="hibernate.jdbc.batch_size" value="0"/>
| </properties>
| </persistence-unit>
| </persistence>
So my persistence context is dependend on datasource org.bf.DS declared in oracle-ds.xml. When I redeploy the oracle-ds.xml file while jboss is running, first all datasources are unbinded, then persistence unit tries to start (and I get NameNotFoundException: org.bf.DS not bound) and after that ConnectionManager for org.bf.DS is bound.
So I changed the persistence.xml as follows to explicitly declare DS dependency:
<persistence>
| <persistence-unit name="org.bf.persistence">
| <jta-data-source>java:/org.bf.DS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto"
| value="update"/>
| <property name="hibernate.dialect"
| value="org.hibernate.dialect.OracleDialect"/>
| <property name="hibernate.jdbc.batch_size" value="0"/>
| <property name="jboss.depends.DS" value="jboss.jdbc:service=metadata,datasource=org.bf.DS"/>
| </properties>
| </persistence-unit>
| </persistence>
Now when redeploying oracle-ds.xml the persistence unit is starting after ConnectionManager is rebounded, but I am getting :
18:13:44,825 WARN [ServiceController] Problem starting service jboss.j2ee:ear=bf.ear,jar=bf.jar,nam
| e=CategoryDAOBean,service=EJB3
| javax.naming.NamingException: Could not bind user transaction for ejb name CategoryDAOBean into JNDI
| under jndiName: /UserTransaction [Root exception is javax.naming.NameAlreadyBoundException]
All entities seems to be correctly redeployed but problem is with my stateless DAO beans dependend on persistence context.
Is there any way to enable correct redeployment of datasource configuration file declaring datasources used by persistence units???
After 2 hours of "research" I workarounded this problem by declaring datasources used by persistence units in separate datasource configuration files:-).
But just for the interest, is there any other solution???
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982731#3982731
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982731
19Â years, 6Â months