0

我从我的 Derby 数据库中删除了一个表,重新生成了“数据库中的实体类”并在 Netbeans 7.0.1 中重新生成了 CRUD 文件,但它不断为已删除的表生成 Facade.class 文件:“SEARCH_CRITERIA_TBL”。

我已经删除了我能找到的与 CRUD 相关的所有内容,并进行了清理和重建,但它坚持要重新生成文件:

\NetBeansProjects\Server\build\web\WEB-INF\classes\JSFBeans\SearchCriteriaTblFacade.class

项目编译但服务器无法启动并出现以下错误:

Blockquote 警告:启动捆绑包 com.sun.enterprise.osgi-adapter [154] 时出现异常 org.osgi.framework.BundleException:捆绑包 com.sun.enterprise.osgi-adapter [154] 中的激活器启动错误。在 org.apache.felix.framework.Felix.activateBundle(Felix.java:1751) 在 org.apache.felix.framework.Felix.startBundle(Felix.java:1622) 在 org.apache.felix.framework.BundleImpl.start (BundleImpl.java:915) 在 org.jvnet.hk2.osgimain.Main.start(Main.java:140) 在 org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:640) 在 org. apache.felix.framework.Felix.activateBundle(Felix.java:1700) 在 org.apache.felix.framework.Felix.startBundle(Felix.java:1622) 在 org.apache.felix.framework.Felix.setActiveStartLevel(Felix. java:1077) 在 org.apache.felix.framework.StartLevelImpl。

Caused by: java.lang.ClassFormatError: Absent Code attribute in method that
    is not native or abstract in class file JSFBeans/SearchCriteriaTblFacade        

at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:920)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1430)
at com.sun.enterprise.deployment.annotation.impl.ModuleScanner.getElements(ModuleScanner.java:247)
at com.sun.enterprise.deployment.archivist.Archivist.processAnnotations(Archivist.java:541)
at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:433)
at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:420)
at com.sun.enterprise.deployment.archivist.Archivist.readRestDeploymentDescriptors(Archivist.java:396)
at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:373)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:238)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:247)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:208)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:148)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:162)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:79)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:612)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:554)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:362)
at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:185)
at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:174)
at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:87)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:84)
at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:77)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58)
at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:236)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:128)
at com.sun.enterprise.module.bootstrap.Main.launch(Main.java:457)
at com.sun.enterprise.module.bootstrap.Main.launch(Main.java:401)
at org.jvnet.hk2.osgiadapter.HK2Main.start(HK2Main.java:125)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:640)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1700)
... 9 more

网络搜索只告诉我“来自实体类的 JSF”没有告诉我它在内部是如何工作的。毫无疑问,我在搜索错误的术语...

有谁知道 Facade.classes 创建数据保存在哪里,或者谁能告诉我我需要搜索哪些术语才能找到?我搜索了整个项目,没有发现对“SearchCriteriaTbl”或“SEARCH_CRITERIA_TBL”的引用。我已经手动删除了 SearchCriteriaTblFacade.class 文件,但是在清理和重建项目时它仍然会重新出现。

提前致谢。

4

1 回答 1

0

Workaround: I re-inserted the deleted table into the database, regenerated the entity classes and CRUD files, and recompiled. Then removed the table again, re-created the entity classes from database and re-did CRUD creation. I then did a refactor delete rather than a normal delete of the unneeded files. After about three clean and recompiles it eventually sorted itself out and is now working.

于 2013-09-03T01:33:33.487 回答