jse环境下用EntityManager配置EJB3的问题

[复制链接]
查看11 | 回复1 | 2017-9-26 13:06:30 | 显示全部楼层 |阅读模式
我最近初学EJB3,需要在jse环境中用hibernate EntityManager 实现EJB3
我现在配置的persistence.xml 如下:

org.hibernate.ejb.HibernatePersistence
quick.Person
quick.Address




















在用如下方法创建EntityManager工厂类时报错:
EntityManagerFactory emf;

public Example()
{
emf=Persistence.createEntityManagerFactory("example",new Properties());
}

得到的报错如下:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/util/file/ArchiveBrowser$Filter

at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:119)

at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)

at quick.Example.(Example.java:23)

at quick.Example.main(Example.java:118)
希望各位给我一些建议和帮助!谢谢!
回复

使用道具 举报

千问 | 2017-9-26 13:06:30 | 显示全部楼层
找不到类阿, 放到classpath
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行