[JBoss Messaging] - java.lang.NoClassDefFoundError: org/jboss/logging/Logger
by chithu21
chithu21 [https://community.jboss.org/people/chithu21] created the discussion
"java.lang.NoClassDefFoundError: org/jboss/logging/Logger"
To view the discussion, visit: https://community.jboss.org/message/740669#740669
--------------------------------------------------------------
I have a strange problem.
I have a JMS client application & an `MDB` configured in Jboss jboss-5.1.0.GA.
Earlier i added the jar by "Configure Build Path" --> "Add External jars" and everything was working fine.
Now, I moved all the jars to a lib folder under my project and used "Configure Build Path" --> "Add jars".
Now I get the following exception while executing the client program. :(
`Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logging/Logger
at org.jnp.interfaces.NamingContext.<clinit>(NamingContext.java:160)
at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:56)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at com.dcat2.messaging.sendreceive.MessageReceiver_test.sendMessage(MessageReceiver_test.java:68)
at com.dcat2.messaging.sendreceive.MessageReceiver_test.main(MessageReceiver_test.java:57)
Caused by: java.lang.ClassNotFoundException: org.jboss.logging.Logger
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more'
I have jndi.properties in the classpath and the following jars.
`jbossall-client.jar
commons-logging.jar
concurrent.jar
javax.ejb.jar
jms.jar
jnp-client-4.2.2.GA.jar
log4j-1.2.16.jar
sqljdbc4.jar`
Can anyone help please....?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/740669#740669]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 10 months
[EJB3] - SFSB state is not beeing maintained in jboss5.1
by Santos Mandre
Santos Mandre [https://community.jboss.org/people/santos2178] created the discussion
"SFSB state is not beeing maintained in jboss5.1"
To view the discussion, visit: https://community.jboss.org/message/740619#740619
--------------------------------------------------------------
Hi Guys,
I am using jboss (http://www.coderanch.com/forums/f-63/JBoss) 5.1 and have written a SFSB - BillItemsListFacadBean which i am trying to invoke from a SLSB - BillFacadBean. The basic purpose of this SFSB is to store list of billitems that were selected as part of generating a document .No database calls involved in the SFSB. It has got 2 simple methods updateDeliveryMemoSelectionList and fetchDeliveryMemoSelectionList .updateDeliveryMemoSelectionList updates the instance variable arrCummulativeDMSelectionList , which is a list and fetchDeliveryMemoSelectionList returns this to the calling program. I am using the below code in a struts (http://www.coderanch.com/forums/f-58/Struts) action class to update the instance variable of the SFSB
BillItemsListFacadBeanInterface billItemsListFacadBean = null;
try{
billItemsListFacadBean = (BillItemsListFacadBeanInterface) new InitialContext (http://docs.oracle.com/javase/7/docs/api/javax/naming/InitialContext.html..."inticraftEAR/BillItemsListFacadBean/local");
}catch(NamingException (http://docs.oracle.com/javase/7/docs/api/javax/naming/NamingException.html) name){
throw new ECSystemException(name.getMessage(),BillCreationAction.class.getName(),METHOD_NAME);
}
ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)<String (http://www.coderanch.com/t/410859/java/java/String-StringBuffer-StringBui...)> arrCheckedItems = new ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)<String>();
StringTokenizer (http://docs.oracle.com/javase/7/docs/api/java/util/StringTokenizer.html) billitemString = new StringTokenizer (http://docs.oracle.com/javase/7/docs/api/java/util/StringTokenizer.html)(..."dmCheckBoxSelectionList_Hidden"),",");
while(billitemString.hasMoreTokens()){
String billitem_id = billitemString.nextToken();
arrCheckedItems.add(billitem_id);
}
ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)<String> arrUnCheckedItems = new ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)<String>();
StringTokenizer (http://docs.oracle.com/javase/7/docs/api/java/util/StringTokenizer.html) billitemString2 = new StringTokenizer (http://docs.oracle.com/javase/7/docs/api/java/util/StringTokenizer.html)(..."dmCheckBoxUnSelectionList_Hidden"),",");
while(billitemString2.hasMoreTokens()){
String billitem_id = billitemString2.nextToken();
arrUnCheckedItems.add(billitem_id);
}
billItemsListFacadBean.updateDeliveryMemoSelectionList(arrCheckedItems, arrUnCheckedItems);
After this now when i try to access this variable in BillFacadBean(SLSB) using the below code the value of the instance variable(arrCummulativeDMSelectionList) of the SFSB is null and hence the method
fetchDeliveryMemoSelectionList returns an empty arraylist.
BillItemsListFacadBeanInterface billItemsListFacadBean = null;
try{
billItemsListFacadBean = (BillItemsListFacadBeanInterface) new InitialContext (http://docs.oracle.com/javase/7/docs/api/javax/naming/InitialContext.html..."inticraftEAR/BillItemsListFacadBean/local");
}catch(NamingException (http://docs.oracle.com/javase/7/docs/api/javax/naming/NamingException.html) name){
throw new ECSystemException(name.getMessage(),BillFacadBean.class.getName(),METHOD_NAME);
}
if(null != billItemsListFacadBean){
arrSelectedBillItems = billItemsListFacadBean.fetchDeliveryMemoSelectionList();
}
Code of SFSB BillItemsListFacadBean is as below:
package com.inticraft.facad;
import java.util.ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html);
import java.util.Iterator (http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html);
import java.util.List (http://docs.oracle.com/javase/7/docs/api/java/util/List.html);
import javax.annotation.PostConstruct (http://docs.oracle.com/javase/7/docs/api/javax/annotation/PostConstruct.html);
import javax.annotation.PreDestroy (http://docs.oracle.com/javase/7/docs/api/javax/annotation/PreDestroy.html);
import javax.ejb.PostActivate (http://docs.oracle.com/javaee/6/api/javax/ejb/PostActivate.html);
import javax.ejb.PrePassivate (http://docs.oracle.com/javaee/6/api/javax/ejb/PrePassivate.html);
import javax.ejb.Remove (http://docs.oracle.com/javaee/6/api/javax/ejb/Remove.html);
import javax.ejb.Stateful (http://docs.oracle.com/javaee/6/api/javax/ejb/Stateful.html);
import javax.interceptor.Interceptors (http://docs.oracle.com/javaee/6/api/javax/interceptor/Interceptors.html);
import com.inticraft.ejbutil.CommitAndCloseInterceptor;
import com.inticraft.ejbutil.LoggingInterceptor;
import com.inticraft.exceptions.ECException;
/**
* Session Bean implementation class BillItemsListFacadBean
*/
@Interceptors({LoggingInterceptor.class})
@Stateful
public class BillItemsListFacadBean implements BillItemsListFacadBeanInterface {
private List <String> arrCummulativeDMSelectionList;
private String first_element;
/**
* Default constructor.
*/
public BillItemsListFacadBean() {
// TODO Auto-generated constructor stub
}
@PostConstruct
@PostActivate
public void openConnection(){
}
@PrePassivate
@PreDestroy
public void cleanup() {
}
@Remove
@Interceptors({CommitAndCloseInterceptor.class})
public void closeDM() throws ECException{
arrCummulativeDMSelectionList = null;
}
(a)Interceptors({CommitAndCloseInterceptor.class})
public void updateDeliveryMemoSelectionList(ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)<String> arrSelectedItems , ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)<String>arrUnSelectedItems) throws ECException {
arrCummulativeDMSelectionList = new ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)<String>();
//Step1 iterate through the unselecteditems and remove from the cummulative list if any entry matches
Iterator <String>it1 = arrUnSelectedItems.iterator();
while(it1.hasNext()){
String unSelectedItem = (String)it1.next();
if(arrCummulativeDMSelectionList.contains(unSelectedItem)){
arrCummulativeDMSelectionList.remove(unSelectedItem);
}
}
Iterator <String>it2 = arrSelectedItems.iterator();
while(it2.hasNext()){
String selectedItem = (String)it2.next();
if(!arrCummulativeDMSelectionList.contains(selectedItem)){
arrCummulativeDMSelectionList.add(selectedItem);
first_element = selectedItem;
}
}
}
(a)Interceptors({CommitAndCloseInterceptor.class})
public ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)<String> fetchDeliveryMemoSelectionList() throws ECException {
if(null == arrCummulativeDMSelectionList){
return new ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)();
}else{
return new ArrayList (http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)(arrCum...);
}
}
}
I am not understaning , why is this variable value null always ie the STATE IS NOT BEING MAINTAINED. Also another thing that i observed was in the jobss jmx console , every time this SFSB was accessed the count got incrmented by 1 , which is making me think , every time this bean is called a new instance of the bean is created , instead of returning the already created instance. I am going nuts over this . any help is greatly appreciated. Thanks a ton in advance and also please let me know if you would need any other information.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/740619#740619]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 10 months