[JBoss and NetBeans] - Netbeans EJB Client Application & jndi.properties
by ddurst@mechdrives.com
I am running Netbeans 5.5 and JBoss 4.0.4.
I am currently experience a problem when I attempt to introduce a jndi.properties file into the <default package> on my EJB Client application module.
In basic I am trying to deploy the EJB ( the .ear ) portion on a remote server and have the EJB Client access it from a desktop.
Upon adding the jndi.properties file + deploying the .ear, JBoss has a issue deploying the new .ear.
Which is as follows:
14:58:39,813 WARN [MDB] Could not find the queue destination-jndi-name=queue/MapCreator
|
| 14:58:39,828 WARN [MDB] destination not found: queue/MapCreator reason: javax.naming.NameNotFoundException: MapCreator not bound
|
| 14:58:39,828 WARN [MDB] creating a new temporary destination: queue/MapCreator
|
| 14:58:40,046 INFO [MapCreator] Bound to JNDI name: queue/MapCreator
|
| 14:58:40,046 WARN [ServiceController] Problem starting service jboss.j2ee:ear=BeltMasta.ear,jar=BeltMasta-ejb.jar,name=MapCreator,service=EJB3
|
| javax.naming.NameNotFoundException: MapCreator not bound
The application worked perfectly before adding the jndi.properties so I know that it is causing the issue, I am just not sure why.
Can someone please explain to be how to properly decouple the EJB Application from the server machine.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127204#4127204
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127204
18 years, 2 months
[JBoss Seam] - Re: Please help ! Can't persist data into related tables
by nickarls
POJO quick and dirty style:
Let's say you have an entity
| @Entity
| public class User {
| @Id @GeneratedValue
| private long id;
| private String name;
|
| public long getId() {
| return id;
| }
|
| public void setId(long id) {
| this.id = id;
| }
|
| public String getName() {
| return name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
| }
|
and then an action class (you could save a few lines by extending EntityController)
| @Name("userActions")
| public class UserActions {
| @In
| private EntityManager entityManager;
| @In
| private FacesMessages facesMessages;
|
| private User user = new User();
|
| public void insert() {
| entityManager.persist(user);
| facesMessages.add("Added user #0", user.getName());
| }
|
| public User getUser() {
| return user;
| }
|
| public void setUser(User user) {
| this.user = user;
| }
| }
|
and the view
| <h:messages globalOnly="true" styleClass="message"/>
| <h:form>
| <h:inputText value="#{userActions.user.name}"/>
| <h:commandButton action="#{userActions.insert}" value="Insert!"/>
| </h:form>
|
For each click on the button, the userActions.insert is called. Since the input text is connected to userActions.user.name, it populates the newly created entity in the bean and persist has something to work on.
If you would have a
| Name("user")
|
on the user class, you would have linked the input field to user.name and then injected the user into the userAction bean with
| @In(create=true)
| private User user;
|
and persist would then have had something to work on. Likewise, if the entity resides in another bean, you connect the input field to someotherbean.user.name and then inject that bean (or the user from that bean) using the @In annotation again. So that your action class has some data to work on.
It is really worth to give the in/outjection part of the manual a good read since it is pretty much the core of the framework...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127201#4127201
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127201
18 years, 2 months