[JBoss Seam] - Re: Injection problem
by koriel
You are refering to the packaging configuration? If yes all my classes are in the jar archive but I don't have the ejb-jar.xml there. I'll try that. Now I have another issue. I want to use utf-16 by default so I wrote a class filter and I put those lines in my web.xml
| <filter>
| <filter-name>Charset Filter</filter-name>
| <filter-class>uai.utilities.CharsetFilter</filter-class>
| <init-param>
| <param-name>requestEncoding</param-name>
| <param-value>UTF-16</param-value>
| </init-param>
| </filter>
|
|
| <filter-mapping>
| <filter-name>Charset Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
my filter class
| public class CharsetFilter implements Filter
| {
| private String encoding;
|
| public void init(FilterConfig config) throws ServletException
| {
| encoding = config.getInitParameter("requestEncoding");
|
| if( encoding==null ) encoding="UTF-16";
| }
|
| public void doFilter(ServletRequest request, ServletResponse response, FilterChain next)
| throws IOException, ServletException
| {
| request.setCharacterEncoding(encoding);
| next.doFilter(request, response);
| }
|
| public void destroy(){}
| }
|
then when I deploy my app and hit the register button is like method is never called and no messages with h:messages. If I replace the UTF-16 with UTF-8 everything works fine. That means that UTF-16 is not supported? And also when I check the character encoding in my page it is UTF-16
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964350#3964350
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964350
19 years, 9 months
[JBoss jBPM] - Re: Error in node-->TaskNode
by harderwu
sorry!
that is misspelled!!
ProcessDefinition:
<start-state name="a">
| <transition name="tra" to="b">
| </transition>
| </start-state>
| <task-node name="b">
| <task name="first">
| <assignment class="com.test.assignment.PartMaster" config-type="bean">
| <groupName>leader</groupName>
| </assignment>
| </task>
| <transition name="tra2" to="c">
| </transition>
| </task-node>
|
|
first,I can get a object of transition that name is "tra",
but there is an error when i get the object of tasknode by the transition.getTo()
TaskNode tasknode = (TaskNode) transition.getTo();
there is not the error if i get the object of node by by the transition.getTo()
Node node = (Node) transition.getTo();
i know the node is the father class of the tasknode, i had seen the code in the exmaple of org.jbpm.test:
public void testTaskNode() {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
"<process-definition>" +
" <task-node name='t' signal='first-wait' create-tasks='false'>" +
" " +
" " +
" " +
" " +
" " +
" </task-node>" +
"</process-definition>"
);
processDefinition = saveAndReload(processDefinition);
TaskNode taskNode = (TaskNode) processDefinition.getNode("t");
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964345#3964345
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964345
19 years, 9 months
[JBoss Seam] - Re: EntityManager: For newbies or to close gaps in your know
by petemuir
Very useful - nice work - might be worth mentioning this in the EJB3/Hibernate forums as it far less confusing than the Hibernate EntityManager reference manual.
anonymous wrote : One of the properties must be an Id (mostly a Long) and the class itself must be annotated with @Entity.
Why a long? (Not come across this before)
anonymous wrote : This needn't happen immediately, he might keep your entity in the cache and write it to the database later.
By default flushes occurs at the method boundary.
anonymous wrote : (Just by the way: Whenever a RuntimeException occurs during a transaction a rollback is performed and all changes to data get revoked).
Just RuntimeException? Not all exceptions? Is it EJB3 or the SeamExceptionFilter that does the rollback?
anonymous wrote : So there's an easy solution: We extend the lifetime of the persistence context so that the entities remain managed during calling multiple transactions/methods. Therefore we change the injection of the EntityManager:
| @PersistenceContext(type=PersistenceContextType.EXTENDED
| | private EntityManager em;
| Now the managed entities "live" in an Extended Persistence Context
The Seam Managed Persistence Context takes this further and provides a conversation scoped entity manager. This prevents Lazy Initialisation Exceptions from occuring when accessing entities from earlier requests.
It needs to be set up in components.xml (see the Configuration section of the reference doc), and then can be accessed via (where mySMPC is the name it was configured under)
@In(create=true) private EntityManager mySMPC;
anonymous wrote : ..."from Entity where lastName=".nameToSearchFor." order by firstName"
It is recommended not to do this but to do
em.createQuery("select e from Entity e where e.lastName = :lastname order by e.firstName").setParameter("lastName", lastName).getResultList();
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964344#3964344
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964344
19 years, 9 months