我正在尝试通过以下指南来增强openJPA类:enhancement-with-eclipse.html
由于某些原因,相同的设置在Windows中可以使用,但是在Ubuntu中却出现了此问题。
有人看到我在做什么错吗?我已经将persistence.xml添加到buildpath中。我已经按照指南进行操作,但仍然遇到以下异常:
[openjpac] <openjpa-2.1.0-r422266:1071316 fatal user error> org.apache.openjpa.util.MetaDataException: MetaDataFactory could not be configured (conf.newMetaDataFactoryInstance() returned null). This might mean that no configuration properties were found. Ensure that you have a META-INF/persistence.xml file, that it is available in your classpath, or that the properties file you are using for configuration is available. If you are using Ant, please see the <properties> or <propertiesFile> attributes of the task's nested <config> element. This can also occur if your OpenJPA distribution jars are corrupt, or if your security policy is overly strict.
[openjpac] at org.apache.openjpa.meta.MetaDataRepository.initializeMetaDataFactory(MetaDataRepository.java:1904)
[openjpac] at org.apache.openjpa.meta.MetaDataRepository.endConfiguration(MetaDataRepository.java:1885)
[openjpac] at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
[openjpac] at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
[openjpac] at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
[openjpac] at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
[openjpac] at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
[openjpac] at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:949)
[openjpac] at org.apache.openjpa.ant.PCEnhancerTask.executeOn(PCEnhancerTask.java:88)
[openjpac] at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:171)
[openjpac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[openjpac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[openjpac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[openjpac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[openjpac] at java.lang.reflect.Method.invoke(Method.java:616)
[openjpac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[openjpac] at org.apache.tools.ant.Task.perform(Task.java:348)
[openjpac] at org.apache.tools.ant.Target.execute(Target.java:390)
[openjpac] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[openjpac] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
[openjpac] at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
[openjpac] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[openjpac] at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[openjpac] at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
[openjpac] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:662)
[openjpac] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:495)
[openjpac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[openjpac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[openjpac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[openjpac] at java.lang.reflect.Method.invoke(Method.java:616)
[openjpac] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:378)
[openjpac] at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate.runInSameVM(AntLaunchDelegate.java:277)
[openjpac] at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate.launch(AntLaunchDelegate.java:239)
[openjpac] at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
[openjpac] at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
[openjpac] at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:696)
[openjpac] at org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.launchBuild(ExternalToolBuilder.java:179)
[openjpac] at org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.doBuildBasedOnScope(ExternalToolBuilder.java:167)
[openjpac] at org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.build(ExternalToolBuilder.java:86)
[openjpac] at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
[openjpac] at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[openjpac] at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
[openjpac] at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
[openjpac] at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
[openjpac] at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[openjpac] at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
[openjpac] at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
[openjpac] at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
[openjpac] at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:330)
[openjpac] at org.eclipse.ui.actions.GlobalBuildAction$1.run(GlobalBuildAction.java:178)
[openjpac] at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
非常感谢您的光临!
最佳答案
我猜想您在META-INF目录或persistence.xml文件的文件名中的某个地方错了。因为Windows不区分大小写,所以在这里并不重要,但是因为UNIX关心大小写,所以它在这里进行。
关于java - 在Eclipse中增强openJPA类,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5250432/