[EJB/JBoss] - Could not dereference object
by Anvar
Hello,
I am using JBoss 4.0.3 sp1 with Java SDK1.5.
Exception: javax.naming.NamingException: Could not dereference object
[Root exception is javax.naming.NameNotFoundException: CustomerHome not bound]
This is my jboss.xml,
<ejb-local-ref>
<ejb-ref-name>ejb/Customer</ejb-ref-name>
<local-jndi-name>plantsby/CustomerHome</local-jndi-name>
</ejb-local-ref>
This is my java code,
private static Hashtable localhomeTable = new Hashtable();
EJBLocalHome home = (EJBLocalHome) localhomeTable.get("java:comp/env/ejb/Customer");
if (home == null) {
try {
InitialContext ic = getInitialContext();
if (ic != null) {
home = (EJBLocalHome) ic.lookup("java:comp/env/ejb/Customer");
}
}
catch (NamingException e) {
}
Any help is greatly appreciated.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009549#4009549
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009549
19Â years, 2Â months
[JBossCache] - How to turn off session replication in JBoss 4.0.4?
by somejunk
Hi,
We are having two JBoss 4.0.4 on the same machine in a cluster in active-active way.With active active cluster, we are running into serializable exceptions because of session replication and are experiencing unacceptable latency. So we have decided to use cluster just for fail over and not for session replication.
I know that our code has objects that are not implementing serializable interface but at this stage we cannot afford to change it. we also feel that we do not have to change it if we are not going for session relication.
After reading some of the posts here and refering couple of other documents, I found out that change of cache mode attribute to local should turn off sessio replication. Also we are using modjk, so I commented out the following
instant
2000
and
jboss.cache:service=TomcatClusteringCache
jboss:service=TransactionManager
Even after making these changes, I still see serializable exceptions.
I am not sure if session replication is happening or not. We do not want session replication, please advice me on the changes that I need to make to turn off session replication...Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009548#4009548
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009548
19Â years, 2Â months
[JBoss Seam] - Re: handling exceptions
by efabiano
Well, I´ve tried to reproduce this behavior using a seam booking example project
and the same error happened (I coudn´t catch the correct exception using exception.xml)
The steps I did were:
1. First, I installed a new Jboss AS 4.05 instalation with EJB 3.0
2. I downloaded new seam 1.1.5
3. I deployed contatc list and booking example aplications on new jboss
4. Using contact list, exception handling with exceptions.xml worked perfectly
5. I changed booking example (which my application was based) in order to use exception.xml
a) first I created exception.xml in the correct folder
b) then, I changed booking example so I could test referencial integrety exceptions
In main.xhtml I included this lines for hotels grid
<h:column>
| <f:facet name="header">remove</f:facet>
| <s:link id="remove" value="remove" action="#{hotelBooking.removeHotel(hot)}"/>
| </h:column>
In HotelBookingAction I added this method:
public void removeHotel(Hotel selectedHotel)
| {
| em.remove(em.merge(selectedHotel));
| hotel = new Hotel();
| }
My exceptions.xml file:
< exceptions>
|
| < exception class="javax.persistence.PersistenceException">
| <redirect view-id="/register.xhtml">Unexpected failure persistence</redirect>
| <end-conversation/>
| < /exception>
|
| < exception class="org.jboss.seam.framework.EntityNotFoundException">
| <redirect view-id="/register.xhtml">Unexpected failure entity no found</redirect>
| <end-conversation/>
| < /exception>
|
| < exception class="org.hibernate.exception.GenericJDBCException">
| <redirect view-id="/register.xhtml">Unexpected generic</redirect>
| <end-conversation/>
| < /exception>
|
| <exception class="org.jboss.tm.JBossRollbackException">
| <redirect view-id="/register.xhtml">Unexpected failure rollback</redirect>
| <end-conversation/>
| </exception>
|
|
| <exception class="java.lang.RuntimeException">
| <redirect view-id="/register.xhtml">Unexpected failure run time</redirect>
| <end-conversation/>
| </exception>
|
|
| <exception >
| <redirect view-id="/register.xhtml">Unexpected failure geral</redirect>
| <end-conversation/>
| </exception>
| </exceptions>
c) then, I run booking application and added some hotels bookings.
d) Finally, I tried remove a hotel with bookings in order to raise a referencial integrety exception. The exception.xml file was read by seam,
but the exception captured was java.lang.RuntimeException!!!
What do I need to do for seam exception handling works in this example?
tks in advance
emerson fabiano
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009538#4009538
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009538
19Â years, 2Â months