SessionBean 与 hibernate 问题
我用sessionbean+hibernate的架构写个小东西,用myeclipse建了一个EJB project,然后写了个sessionbean,用jboss服务器进行测试了一下,正常运行,但是当我把hibernate libraries
build path进来以后,还没有用sessionbean掉hibernate就出现了以下异常:
Exception in thread "main" java.lang.NoSuchFieldError: TRACE
at org.jboss.logging.Log4jLoggerPlugin.isTraceEnabled(Log4jLoggerPlugin.java:85)
at org.jboss.logging.Logger.isTraceEnabled(Logger.java:122)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:622)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.test.test.main(test.java:21)
难道是lib冲突???
该怎么解决呢,请各位帮帮忙.....
谢谢....
test.java:
Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.provider.url", "localhost:1099");
props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
InitialContext ctx;
try{
ctx = new InitialContext(props);
MyHibernateBeanRemote sample = (MyHibernateBeanRemote) ctx.lookup("MyHibernateBean/remote");
if(sample != null)
{
sample.doSomething();
}
else
System.out.print("Not found");
}catch(NamingException e){
System.out.print(e.getMessage());
}