I am trying to connect to a database using Facade. I am using Netbeans 7.3.1 JDK 1.7 and JAva EE 7.
There is a Enterprise Application, a client application couple of beans and a class library. I mostly used the insert code method in netbeans to create the connections. I get the following error:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:446)
at org.glassfish.appclient.client.AppClientFacade.launch(AppClientFacade.java:183)
atorg.glassfish.appclient.client.AppClientGroupFacade.main(AppClientGroupFacade.java:65)
Caused by: javax.ejb.EJBException
at com.sun.ejb.containers.EJBContainerTransactionManager.processSystemException(EJBContainerTransactionManager.java:748)
at com.sun.ejb.containers.EJBContainerTransactionManager.completeNewTx(EJBContainerTransactionManager.java:698)
at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:503)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4475)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2009)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1979)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:212)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:79)
at com.sun.proxy.$Proxy299.count(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
And
Caused by: java.lang.IllegalArgumentException: No [EntityType] was found for the key class [com.javaee.test.db.Questions] in the Metamodel - please verify that the [Entity] class was referenced in persistence.xml using a specific <class>com.javaee.test.db.Questions</class> property or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element.
at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.entityEmbeddableManagedTypeNotFound(MetamodelImpl.java:173)
at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.entity(MetamodelImpl.java:193)
at org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.internalFrom(CommonAbstractCriteriaImpl.java:114)
at org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl.from(AbstractQueryImpl.java:246)
I am not sure where exactly the problem might be so i didn't post any of the code. If you have a hint I can put down the code.
I had the same error last night. I think we are taking the same class! To fix it expand the ejb project -> Configuration Files -> persistence.xml
Under General, there is a checked checkbox "Include All Entity Classes in _ Module". I unchecked the box and then added each class manually. That took care of the exception. Hope this helps.
Related
I am trying to run a vertx server with dynamoDB and lombok annotations, and I am unable to get it to work properly. I have added the .jar files for vertx, dynamoDB, and lombok to my classpath. Everything compiles fine in IntelliJ, but I cannot get it to run properly from my terminal.
I get:
Users-MacBook-Pro:Server User$ vertx run Server.java
java.lang.RuntimeException: Resource not found: Server.java
at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:73)
at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:38)
at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:184)
at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:157)
at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158)
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:130)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:102)
at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:90)
at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:574)
at io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer.deploy(VertxIsolatedDeployer.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.vertx.core.impl.launcher.commands.ClasspathHandler.deploy(ClasspathHandler.java:160)
at io.vertx.core.impl.launcher.commands.RunCommand.deploy(RunCommand.java:389)
at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:262)
at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:365)
at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
at io.vertx.core.Launcher.main(Launcher.java:49)
Failed in deploying verticle
java.lang.RuntimeException: Resource not found: Server.java
at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:73)
at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:38)
at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:184)
at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:157)
at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158)
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:130)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:102)
at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:90)
at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:574)
at io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer.deploy(VertxIsolatedDeployer.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.vertx.core.impl.launcher.commands.ClasspathHandler.deploy(ClasspathHandler.java:160)
at io.vertx.core.impl.launcher.commands.RunCommand.deploy(RunCommand.java:389)
at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:262)
at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:365)
at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
at io.vertx.core.Launcher.main(Launcher.java:49)
java.lang.RuntimeException: Resource not found: Server.java
at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:73)
at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:38)
at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:184)
at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:157)
at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158)
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:130)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:102)
at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:90)
at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:574)
at io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer.deploy(VertxIsolatedDeployer.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.vertx.core.impl.launcher.commands.ClasspathHandler.deploy(ClasspathHandler.java:160)
at io.vertx.core.impl.launcher.commands.RunCommand.deploy(RunCommand.java:389)
at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:262)
at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:365)
at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
at io.vertx.core.Launcher.main(Launcher.java:49)
Would appreciate some help with this!
This error simply tells you that the Vert.x CLI could not find the Server.java file in the current working directory.
Given that you use Lombok (which modifies code at compile time), I would recommend to run your Verticle after you compiled it with your IDE or build tool.
Here is a list of possibilities to start a Verticle
I was able to fix this issue by creating a fat jar module out of my project. I followed this for help: http://vertx.io/blog/my-first-vert-x-3-application/
When I run my NetLogo model with extension GIS in Linux, I obtain this error message:
Error: Could not find mediaLib accelerator wrapper classes. Continuing in pure Java mode.
Occurs in: com.sun.media.jai.mlib.MediaLibAccessor
java.lang.NoClassDefFoundError: com/sun/medialib/mlib/Image
at com.sun.media.jai.mlib.MediaLibAccessor$1.run(MediaLibAccessor.java:248)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.media.jai.mlib.MediaLibAccessor.setUseMlib(MediaLibAccessor.java:245)
at com.sun.media.jai.mlib.MediaLibAccessor.useMlib(MediaLibAccessor.java:177)
at com.sun.media.jai.mlib.MediaLibAccessor.isMediaLibCompatible(MediaLibAccessor.java:357)
at com.sun.media.jai.mlib.MediaLibAccessor.isMediaLibCompatible(MediaLibAccessor.java:315)
at com.sun.media.jai.mlib.MlibScaleRIF.create(MlibScaleRIF.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory
...
How can I resolve this problem ?
It's a system property, so you'd have to do it at a system level, i.e. by adding -Dcom.sun.media.jai.disableMediaLib=true in your VM Options.
Known issue; see https://github.com/NetLogo/GIS-Extension/issues/4
I don't think this error being printed actually affects anything. Is something not working, or are you just concerned about seeing the error message? If the extension seems to work, I wouldn't worry.
I made a Transform to send JMS Produce to ActiveMQ.
but during executing the transform via my Java Client Application including PDI Jars.
I faced this Error :
SEVERE: null
org.pentaho.di.core.exception.KettleMissingPluginsException:
Missing plugins found while loading a transformation
Step : JmsOutput
at org.pentaho.di.trans.TransMeta.loadXML(TransMeta.java:2840)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2676)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2628)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2605)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2585)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2550)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2513)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
so any Help please?
From the infocenter.pentaho.com:
Note: Place JMS Library jars for the ConnectionFactory and other supporting classes in the .../data-integration/plugins/pdi-jms-plugin/lib directory.
I want to create my own scaffold's provider for jboss forge 1.4.4, for do that I forked the files on github.
I add succesfully the plugin with command: forge source-plugins path/to/plugins
I can add the plugins to my project with scaffold setup --scaffoldType mFaces
But when I run the command scaffold from-entity com.model.*
I get the error:
ERROR Exception encountered: Unable to locate scaffold/faces/metawidget-qbe.xml on CLASSPATH (type "set VERBOSE true" to enable stack traces)
there is the full output:
***INFO*** Using currently installed scaffold [mfaces]
java.io.FileNotFoundException: Unable to locate scaffold/faces/metawidget-qbe.xml on CLASSPATH
***ERROR*** Exception encountered: (type "set VERBOSE false" to disable stack traces)
[testScaffoldS] testScaffoldS $ at org.metawidget.config.impl.SimpleResourceResolver.openResource(SimpleResourceResolver.java:75)
at org.metawidget.config.impl.BaseConfigReader.configure(BaseConfigReader.java:216)
at org.metawidget.pipeline.w3c.W3CPipeline.configure(W3CPipeline.java:153)
at org.metawidget.pipeline.base.BasePipeline.configureOnce(BasePipeline.java:152)
at org.metawidget.pipeline.base.BasePipeline.inspectAsDom(BasePipeline.java:335)
at org.metawidget.statically.StaticMetawidget.inspect(StaticMetawidget.java:332)
at org.metawidget.statically.StaticMetawidget.write(StaticMetawidget.java:278)
at org.jboss.forge.scaffold.mfaces.FacesScaffold.generateFromEntity(FacesScaffold.java:298)
at org.jboss.forge.scaffold.plugins.ScaffoldPlugin.generateFromEntity(ScaffoldPlugin.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.forge.shell.command.Execution.perform(Execution.java:160)
at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:109)
at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:47)
at org.jboss.forge.shell.ShellImpl$ExecutorThread.run(ShellImpl.java:796)
at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:819)
at org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:609)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)
at org.jboss.forge.shell.ShellImpl$Proxy$_$$_WeldClientProxy.doShell(ShellImpl$Proxy$_$$_WeldClientProxy.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)
at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635)
at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:622)
at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:616)
at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:186)
at java.lang.Thread.run(Thread.java:722)
I removed the old plugins: scaffold-faces
I find the same question here but it not resolved:
Creating own scaffold plugin: metawidget resource loading exception only when run within forge console
Try comparing your implementation to https://github.com/forge/plugin-spring-mvc.
That is another Forge plugin that overrides the default scaffold (uses Spring instead of JSF). In particular for your problem, it has a metawidget-qbe.xml file: https://github.com/forge/plugin-spring-mvc/tree/master/src/main/resources/scaffold/spring
I am trying to put together a accumulo/cloudera quickstart. Accumulo is running, but I am having problems attempting to execute samples, namely hellowworld.
It appears it is finding hadoop and not accumulo classes?
Following is execution and error messages. I appreciate your assistance!
./bin/accumulo org.apache.accumulo.examples.simple.helloworld.InsertWithOutputFormat "instance" localhost:2181 "username" "password" hellotable
Thread "org.apache.accumulo.examples.simple.helloworld.InsertWithOutputFormat" died nulljava.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.accumulo.start.Main$1.run(Main.java:89)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected
at org.apache.accumulo.core.util.ContextFactory.createTaskAttemptContext(ContextFactory.java:131)
at org.apache.accumulo.examples.simple.helloworld.InsertWithOutputFormat.run(InsertWithOutputFormat.java:56)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.accumulo.examples.simple.helloworld.InsertWithOutputFormat.main(InsertWithOutputFormat.java:76)
... 6 more
Problem solved by:
1) Using cdh4 accumulo-1.4.3 tar
2) adding additional users
3) ensuring write permissions on supporting jars