[JBoss Seam] - Re: 2 DataModel questions
by bfo81
I've already seen an example with a nested table. But the problem is that you cannot put that nested table in a new ROW, since rows are "connected" only to the entities you iterate. But you can put a "sub-table" in a COLUMN.
2) I had an idea about your second question. You might add a property delete (with default value false) to your listed entities and connect it to a SelectBooleanCheckbox. And at the bottom of the table you have a button "Delete selected items".
<h:dataTable var="item" value="#{listOfItems}" ...
|
| ...<h:column><h:selectBooleanCheckbox value="#{item.delete}" /></h:column>...
|
| </h:dataTable>
|
| <h:commandButton value="Delete selected items" action="#{actionBean.deleteSelected}" />
@Name("actionBean")
| ...
| public String deleteSelected() {
| for (Item item: listOfItems)
| if (item.isDelete())
| em.remove(item);
| return null;
| }
That's the plain idea. I think it should work, but maybe you need to regard things like e.g. reloading the list after deletion. And when having problems with detached entities use em.remove(em.find(Item.class, item.getId())); to work on managed entities.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968600#3968600
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968600
18 years, 4 months
[EJB 3.0] - Starting failed persistence; jdbc not bound... Why???
by meuter
Hi,
I'm new to EJB3 and JBoss. Appologies on forehand for a possible mispost. I have the following problem. I created a web application where i want to handle user registration. A EJB-module handles the creation, authentication and removal of a user on a postgreSQL DB-table. The datasource xml and peristence xml are located in the ejb-module and automatically generated by netbeans 5.5. I double checked those with examples from documentation. The applcation makes use of two servlets to login and register a user. These servlets are also correctly registered according to tutorials. I cannot deploy the application: The fololowing error is generated:
Starting persistence.units:ear=Construct.ear,jar=Construct-ejb.jar,unitName=construct-PU
2006-08-31 12:31:07,971 DEBUG [org.jboss.ejb3.entity.PersistenceUnitDeployment] Found persistence.xml file in EJB3 jar
2006-08-31 12:31:07,971 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting failed persistence.units:ear=Construct.ear,jar=Construct-ejb.jar,unitName=construct-PU
javax.naming.NameNotFoundException: jdbc not bound
What is happening? The datasource is available is \\jboss\server\default\deploy.
I'm using Windows XP, Netbeans 5.5 beta, Jboss 4.04, postgreSQL 8.1.
Any help is highly appreciated.
cheers,
Eelco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968595#3968595
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968595
18 years, 4 months
[Clustering/JBoss] - HA-JNDI Namespace in JMX Console
by MarcReis
I have a cluster of two 4.0.4 and have been clustering for a while.
Shortly I noticed that a new test app showed up under the HA-JNDI Namespace, before clustered beans didn?t do that.
They always appeared in the Global Namespace. I didn?t bother with it before, since failover and load balancing still worked. I thought it was just a issue with the view...
After changing a bit here an there on the test app, I at some time noticed that it disappeared form the HA-JNDI to the Global namespace again.
All attempts to get it back under the HA JNDI have failed. The app works ok, but it just doesn?t show up. I did a minimal SFSB to try this again, with no luck.
What config to I need to have, so that theoretically the Bean will land in HA JNDI? If it doesn?t show up there, does this mean the naming will run through HA-JNDI, find nothing, and then go through the Global namespace or is this just a "view" problem ?
Just to show the class (Interfaces are omitted, there naked, just the one method and a field with the jndi name and a @Remote and @Local for the corresponding interface) :
There is just annotation config, no ejb-jar.xml or jboss.xml in the META-INF .
(I did try with them, and diverse settings in each of them. I guess if the problem is the config, I missed the right mix except that one time. I wanted to go simple, since in other apps I had the feeling that the mixing of annotation, ejb xml and jboss xml is at the moment not always working right).
| package de.somewhere.dummy.bean;
|
| import javax.ejb.Stateful;
|
| import org.jboss.annotation.ejb.Clustered;
| import org.jboss.annotation.ejb.LocalBinding;
| import org.jboss.annotation.ejb.RemoteBinding;
|
| import de.somewhere.dummy.interfaces.IDoSomeWorkSFSBLocal;
| import de.somewhere.dummy.interfaces.IDoSomeWorkSFSBRemote;
|
| @Stateful
| @Clustered(partition= "DefaultPartition", loadBalancePolicy = org.jboss.ha.framework.interfaces.RoundRobin.class)
| @RemoteBinding(jndiBinding = "DUMMY/DoSomeWorkSFSB/remote")
| @LocalBinding(jndiBinding = "DUMMY/DoSomeWorkSFSB/local")
| public class DoSomeWorkSFSB implements IDoSomeWorkSFSBRemote,
| IDoSomeWorkSFSBLocal{
| private String lastString="";
| private String lastResult="";
|
| public DoSomeWorkSFSB(){
|
| }
|
| public String mirrorString(String sText){
| if(sText==lastString)
| return lastResult;
|
| lastString = sText;
| lastResult = "";
| for (int i=sText.length()-1; i>=0; i--){
| lastResult += sText.charAt(i);
| }
| System.out.println(lastResult);
| return lastResult;
| }
|
| }
|
Sincerly
Marc
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968593#3968593
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968593
18 years, 4 months
[JBoss jBPM] - Accessing the underlaying hibernate session / transaction
by harrylette
Hi all!
I am evaluating JBPM for as the workflow engine for my company. I am quite enthusiastic about this nice piece of software. Since a week I surfed this forum and it helped me a lot. Know I am at a point to begin coding my enine, but there is one crucial question:
Am I allowed to use code like this in a Node's ActionHandler:
| public void execute(ExecutionContext executionContext) throws Exception {
|
| this.jbpmContext = executionContext.getJbpmContext();
| jbpmContext.getSession().beginTransaction();
| try {
| doSth();
| } catch (MdcInstanceExistsExcepiton e) {
| handleSth{}
| }
|
| jbpmContext.save(executionContext.getProcessInstance());
| jbpmContext.getSession().getTransaction().commit();
|
| executionContext.getNode().leave(executionContext);
|
| }
|
My Comments:
1 I KNOW that you do not advise to save sth. in an actionhandler, but we have here some
situations where I have to guarantee that data is really written to the database.
3 I have seen that similar methods in JbpmSession are deprecated. Why?
2 This code works fine within my tests.
My question:
Does this approach actually break anything of the inner workflow of the surrounding jbpmContext?
By the way: Is there a tool out there, that shows me the actual state of all processes? Sth. like
a "JBPM shell" or "JBPM Webmin"? I only know about the StartersKit webapp...
Best Regards & any help is greatfully appreciated!!
Harry
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968592#3968592
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968592
18 years, 4 months