Jboss Seam: Enabling Debug page on WebLogic 10.3.2 (11g)

You get the following exception No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed) But you said you have installed an ejb and web maven project. Maybe both includes a SeamPhaseListener when you deploy your application. It, maybe, explains why you get your exception (Two SeamPhaseListener instances … Read more

Hibernate native query – char(3) column

It looks like Hibernate reads value of type CHAR(n) as Character. Try to cast it to VARCHAR(n): Query q2 = em.createNativeQuery( “select cast(sc_cur_code as VARCHAR2(3)), sc_amount from sector_costs”); When using Hibernate via Session interface, you can explcitly set a type of result with addScalar() instead (also accessible via unwrap() in JPA 2.0): Query q2 = … Read more

Force refresh of collection JPA entityManager

You’re having two separate problems here. Let’s take the easy one first. javax.ejb.EJBTransactionRolledbackException: Entity not managed The List of objects returned by that query is not itself an Entity, and so you can’t .refresh it. In fact, that’s what the exception is complaining about. You’re asking the EntityManager to do something with an object that … Read more

Mixing JSF EL in a JavaScript file

Five ways: Declare it as global variable in the parent JSF page. <script type=”text/javascript” src=”https://stackoverflow.com/questions/2547814/script.js”></script> <script type=”text/javascript”> var messages = []; <ui:repeat value=”#{bean.messages}” var=”message”> messages[‘#{message.key}’] = ‘#{message.value}’; </ui:repeat> </script> Or, if it’s in JSON format already. <script type=”text/javascript” src=”https://stackoverflow.com/questions/2547814/script.js”></script> <script type=”text/javascript”>var messages = #{bean.messagesAsJson};</script> Put the whole <script> in a XHTML file and use ui:include … Read more