为netbeans平台重建.jar文件

时间:2014-08-27 07:11:29

标签: java netbeans netbeans-platform

我有一个java项目(Netbeans平台和用于ORM的hibernate).i使用hibernate构建实体并将此jar文件添加到我的项目中它工作正常,当我向数据库添加新表并重建实体时,它有错误。虽然我已经检查了我的代码,但找不到新的实体类,但我找不到任何解决方案。请帮帮我(我的表名是菜单)

这是我的代码

for (int i = 0; i < table_row; i++) {
                Menu menus = (Menu) items.get(i);
                objectData[i][0] = menus.getId();
                objectData[i][1] = menus.getTitle();
                objectData[i][2] = menus.getLevel();
                objectData[i][3] = menus.getParentId();
                objectData[i][4] = menus.getClassname();
                objectData[i][5] = menus.getCategoryId();
                objectData[i][6] = menus.getIcon();
                objectData[i][7] = menus.getOrder();
                objectData[i][8] = menus.getCreated();
                objectData[i][9] = menus.getModified();
            }

这是例外

Classes: loaded=3871 total loaded=3871 unloaded 0
INFO [org.netbeans.core.ui.warmup.DiagnosticTask]: Total memory 4,074,373,120
INFO [null]: Total physical memory 4,074,373,120
SEVERE [global]
java.lang.ClassNotFoundException: com.osstech.dbentities.Menu
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:222)
Caused: java.lang.ClassNotFoundException: com.osstech.dbentities.Menu starting from ModuleCL@302d6b3[com.osstech.Systems] with possible defining loaders [ModuleCL@759d36f1[com.osstech.dbentities]] and declared parents [ModuleCL@7f28abd9[org.netbeans.modules.settings], ModuleCL@fcd0400[org.openide.windows], org.netbeans.MainImpl$BootClassLoader@6db17b38, ModuleCL@561ac555[org.netbeans.api.progress], ModuleCL@52b4e7ec[com.osstech.DataAccess], ModuleCL@759d36f1[com.osstech.dbentities], ModuleCL@2716630b[com.osstech.wraplibrary], ModuleCL@6461d2bf[com.osstech.Utilities], ModuleCL@f27bf78[org.openide.awt]]
    at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:224)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Caused: java.lang.NoClassDefFoundError: com/osstech/dbentities/Menu

1 个答案:

答案 0 :(得分:0)

需要一些代码才能最终说出来。但是,看起来你在layer.xml中配置了一个名为com.osstech.dbentities.Menu的菜单。这是错误的配置。当netbeans试图实现这个对象时,它无法找到它。