Hello I am trying run a simple test in a web app using Play! Framework, but I got a error:
[info] RouteTest
[error] Test RouteTest.testRouteActivityIndex failed: DataSource user is null?
[error] at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.<init>(DataSourcePool.java:198)
[error] at com.avaje.ebeaninternal.server.lib.sql.DataSourceManager.getDataSource(DataSourceManager.java:210)
[error] at com.avaje.ebeaninternal.server.lib.sql.DataSourceGlobalManager.getDataSource(DataSourceGlobalManager.java:63)
[error] at com.avaje.ebeaninternal.server.core.DefaultServerFactory.getDataSourceFromConfig(DefaultServerFactory.java:427)
[error] at com.avaje.ebeaninternal.server.core.DefaultServerFactory.setDataSource(DefaultServerFactory.java:388)
[error] at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:168)
[error] at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:125)
[error] at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:64)
[error] at com.avaje.ebean.EbeanServerFactory.create(EbeanServerFactory.java:64)
[error] at com.avaje.ebean.Ebean$ServerManager.getWithCreate(Ebean.java:237)
[error] at com.avaje.ebean.Ebean$ServerManager.get(Ebean.java:224)
[error] at com.avaje.ebean.Ebean$ServerManager.access$200(Ebean.java:159)
[error] at com.avaje.ebean.Ebean.getServer(Ebean.java:288)
[error] at play.db.ebean.Model$Finder.server(Model.java:216)
[error] at play.db.ebean.Model$Finder.all(Model.java:230)
[error] at models.Activity.all(Activity.java:29)
[error] at controllers.Application.activities(Application.java:18)
[error] at Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.apply(routes_routing.scala:60)
[error] at Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.apply(routes_routing.scala:60)
[error] at play.core.Router$HandlerInvoker$$anon$4$$anon$1.invocation(Router.scala:1086)
[error] at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:33)
[error] at play.core.j.JavaAction$class.apply(JavaAction.scala:74)
[error] at play.core.Router$HandlerInvoker$$anon$4$$anon$1.apply(Router.scala:1085)
[error] at play.test.Helpers.invokeHandler(Helpers.java:34)
[error] at play.test.Helpers.routeAndCall(Helpers.java:246)
[error] at play.test.Helpers.routeAndCall(Helpers.java:231)
[error] at RouteTest.testRouteActivityIndex(RouteTest.java:14)
[error] ...
[info] x RouteTest.testRouteActivityIndex
The code of test is:
#Test
public void testRouteActivityIndex(){
Result result = routeAndCall(fakeRequest(GET, "/activities"));
Assert.assertNotNull(result);
}
I tried researching the error, but did not find anything very useful for this case, even the site's play!. someone has gone through this?
Your /activities action probably make some calls to the DB.
So you should make your test in a running fake application as explained in the "Running in a fake application" section of this documentation: http://www.playframework.org/documentation/2.0.3/JavaTest
And don't forget to import the static Helper:
import static play.test.Helpers.*;
Related
Im trying to start a project on play in IntelliJ IDEA Ultimate MacBook Pro on M1, I get the following error in the console:
[error] java.lang.UnsatisfiedLinkError:
/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp:
dlopen(/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp,
0x0001): tried:
'/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp'
(fat file, but missing compatible architecture (have 'i386,x86_64',
need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
I tried to reinstall the JDK on the arm architecture after deleting all the JDKs, it did not help
What needs to be tricked to fix this?
Full StackTrace:
[error] java.lang.UnsatisfiedLinkError: /Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp: dlopen(/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp, 0x0001): tried: '/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
[error] at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
[error] at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
[error] at java.base/java.lang.Runtime.load0(Runtime.java:768)
[error] at java.base/java.lang.System.load(System.java:1837)
[error] at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
[error] at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
[error] at com.sun.jna.Native.<clinit>(Native.java:195)
[error] at io.methvin.watchservice.jna.CarbonAPI.<clinit>(CarbonAPI.java:19)
[error] at io.methvin.watchservice.jna.CFStringRef.toCFString(CFStringRef.java:23)
[error] at io.methvin.watchservice.MacOSXListeningWatchService.register(MacOSXListeningWatchService.java:101)
[error] at io.methvin.watchservice.WatchablePath.register(WatchablePath.java:50)
[error] at io.methvin.watcher.DirectoryWatcher.register(DirectoryWatcher.java:352)
[error] at io.methvin.watcher.DirectoryWatcher.registerAll(DirectoryWatcher.java:317)
[error] at io.methvin.watcher.DirectoryWatcher.<init>(DirectoryWatcher.java:167)
[error] at io.methvin.watcher.DirectoryWatcher$Builder.build(DirectoryWatcher.java:118)
[error] at play.dev.filewatch.DefaultFileWatchService.watch(DefaultFileWatchService.scala:38)
[error] at play.dev.filewatch.FileWatchService$$anon$1.watch(FileWatchService.scala:87)
[error] at play.runsupport.Reloader.<init>(Reloader.scala:414)
[error] at play.runsupport.Reloader$.reloader$lzycompute$1(Reloader.scala:259)
[error] at play.runsupport.Reloader$.play$runsupport$Reloader$$reloader$1(Reloader.scala:251)
[error] at play.runsupport.Reloader$.startDevMode(Reloader.scala:271)
[error] at play.sbt.run.PlayRun$.devModeServer$lzycompute$1(PlayRun.scala:99)
[error] at play.sbt.run.PlayRun$.devModeServer$1(PlayRun.scala:83)
[error] at play.sbt.run.PlayRun$.$anonfun$playRunTask$3(PlayRun.scala:106)
[error] at play.sbt.run.PlayRun$.$anonfun$playRunTask$3$adapted(PlayRun.scala:68)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] stack trace is suppressed; run 'last Compile / run' for the full output
[error] (Compile / run) java.lang.UnsatisfiedLinkError: /Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp: dlopen(/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp, 0x0001): tried: '/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
Found a solution:
Inside sbt 1.4.6 there is a JNA library version 5.5.0, which apparently does not have the necessary files for the arm64 architecture processor
Raising the sbt version to 1.6.2 helped
I am compling dbeaver-7.2.2 on mips64el platform using the command "mvn package -DskipTests=true". it fails and displays error as follws:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.7.0:compile (default-compile) on project org.jkiss.dbeaver.ui: Compilation failure: Compilation failure:
[ERROR] /root/dbeaver-7.2.2/plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/properties/PropertyTreeViewer.java:
[ERROR] /*
[ERROR] ^
[ERROR] The type org.eclipse.swt.widgets.Control cannot be resolved. It is indirectly referenced from required .class files
[ERROR] /root/dbeaver-7.2.2/plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/properties/PropertyTreeViewer.java:[1101]
[ERROR] private class SortListener implements Listener {
[ERROR] ^^^^^^^^
[ERROR] Listener cannot be resolved to a type
[ERROR] /root/dbeaver-7.2.2/plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/properties/PropertyTreeViewer.java:[1173]
[ERROR] class PaintListener implements Listener {
[ERROR] ^^^^^^^^
[ERROR] Listener cannot be resolved to a type
[ERROR] 3 problems (3 errors)
[ERROR] -> [Help 1]
ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :org.jkiss.dbeaver.ui
the class PaintListener belogs to org.eclipse.swt.gtk.linux.mips64el which has been compiled successfully.i have set org.eclipse.swt.gtk.linux.mips64el classpath ,but it stills fail.
dbeaver-7.2.2 source code:https://github.com/dbeaver/dbeaver/releases/tag/7.2.2
[ERROR] The type org.eclipse.swt.widgets.Control cannot be resolved. It is indirectly referenced from required .class files
the class PaintListener belogs to org.eclipse.swt.gtk.linux.mips64el which has been compiled successfully.i have set org.eclipse.swt.gtk.linux.mips64el classpath ,but it stills fail.
unable to install apache maven packages in gcp console please let me know if any one resolves the issue. I'm trying to create dataflow pipeline following the below link
enter link description here
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.368 s
[INFO] Finished at: 2020-08-30T15:27:29Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project common: Compilation failure: Compilation failure:
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/utils/CacheUtils.java:[78,12] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: class com.google.cloud.teleport.v2.utils.CacheUtils.DataStreamPkCache
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/utils/CacheUtils.java:[80,30] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: class com.google.cloud.teleport.v2.utils.CacheUtils.DataStreamPkCache
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/cdc/mappers/MergeInfoMapper.java:[29,42] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: package com.google.cloud.teleport.v2.utils
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/cdc/mappers/MergeInfoMapper.java:[59,11] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: class com.google.cloud.teleport.v2.cdc.mappers.MergeInfoMapper
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :common
By now this is well known to developers bug, confirmed on my side, getting the same kafka-to-bigquery template compilation error around DataStreamClient class. Seems the new PR for CacheUtils.java is going to appear soon, more info here.
I am building the jboss EA 6.3 quickstart project "greeter".
I run maven clean install jboss-as:deploy in the project dir as instructed whilist a jboss server is running.
I get the following errors:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
1:compile (default-compile) on project jboss-greeter: Compilation failure: Compi
lation failure:
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\faces\j
boss-jsf-api_2.1_spec\2.1.28.Final-redhat-1\jboss-jsf-api_2.1_spec-2.1.28.Final-
redhat-1.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\hibernate\javax\persiste
nce\hibernate-jpa-2.0-api\1.0.1.Final-redhat-2\hibernate-jpa-2.0-api-1.0.1.Final
-redhat-2.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\transac
tion\jboss-transaction-api_1.1_spec\1.0.1.Final-redhat-2\jboss-transaction-api_1
.1_spec-1.0.1.Final-redhat-2.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\ejb\jbo
ss-ejb-api_3.1_spec\1.0.2.Final-redhat-2\jboss-ejb-api_3.1_spec-1.0.2.Final-redh
at-2.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\faces\j
boss-jsf-api_2.1_spec\2.1.28.Final-redhat-1\jboss-jsf-api_2.1_spec-2.1.28.Final-
redhat-1.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\hibernate\javax\persiste
nce\hibernate-jpa-2.0-api\1.0.1.Final-redhat-2\hibernate-jpa-2.0-api-1.0.1.Final
-redhat-2.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\transac
tion\jboss-transaction-api_1.1_spec\1.0.1.Final-redhat-2\jboss-transaction-api_1
.1_spec-1.0.1.Final-redhat-2.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\ejb\jbo
ss-ejb-api_3.1_spec\1.0.2.Final-redhat-2\jboss-ejb-api_3.1_spec-1.0.2.Final-redh
at-2.jar; error in opening zip file
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/Resources.java:[24,27] packag
e javax.faces.context does not exist
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/Resources.java:[44,12] cannot
find symbol
[ERROR] symbol: class FacesContext
[ERROR] location: class org.jboss.as.quickstarts.greeter.Resources
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/web/CreateController.java:[21
,31] package javax.faces.application does not exist
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/web/CreateController.java:[22
,27] package javax.faces.context does not exist
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/web/CreateController.java:[34
,13] cannot find symbol
[ERROR] symbol: class FacesContext
[ERROR] location: class org.jboss.as.quickstarts.greeter.web.CreateController
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.jav
a:[23,25] cannot find symbol
[ERROR] symbol: class SystemException
[ERROR] location: package javax.transaction
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.jav
a:[24,25] cannot find symbol
[ERROR] symbol: class UserTransaction
[ERROR] location: package javax.transaction
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.jav
a:[32,13] cannot find symbol
[ERROR] symbol: class UserTransaction
[ERROR] location: class org.jboss.as.quickstarts.greeter.domain.ManagedBeanUserD
ao
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/EJBUserDao.java:[19,17
] package javax.ejb does not exist
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/EJBUserDao.java:[26,2]
cannot find symbol
[ERROR] symbol: class Stateful
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/Resources.java:[45,16] cannot
find symbol
[ERROR] symbol: variable FacesContext
[ERROR] location: class org.jboss.as.quickstarts.greeter.Resources
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/web/CreateController.java:[48
,47] cannot find symbol
[ERROR] symbol: class FacesMessage
[ERROR] location: class org.jboss.as.quickstarts.greeter.web.CreateController
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/web/CreateController.java:[51
,47] cannot find symbol
[ERROR] symbol: class FacesMessage
[ERROR] location: class org.jboss.as.quickstarts.greeter.web.CreateController
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.jav
a:[50,22] cannot find symbol
[ERROR] symbol: class SystemException
[ERROR] location: class org.jboss.as.quickstarts.greeter.domain.ManagedBeanUserD
ao
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.jav
a:[68,22] cannot find symbol
[ERROR] symbol: class SystemException
[ERROR] location: class org.jboss.as.quickstarts.greeter.domain.ManagedBeanUserD
ao
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
I checked the files it tries to open in the maven repo. They all are 1kb large and won't open by winrar. Windows says "file corrupt or damaged".
Other examples (without JSF though) worked just fine.
What is your M2_HOME? You can configure the path in the M2_HOME/conf/settings.xml, e.g.:
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
I removed the specified files that maven couldn't open. Maven redownloaded them, then it worked just fine.
i am running openIE in scala. while running sbt run i got error. can any body explain?
Set current project to openie (in build file:/home/user_name/Videos/openie-master/)
[info] Running edu.knowitall.openie.OpenIECli
[error] Exception in thread "main" java.lang.NoSuchFieldError: MODULE$
[error] at scala.util.PropertiesTrait$class.scalaPropOrNone(Properties.scala:65)
[error] at scala.util.Properties$.scalaPropOrNone(Properties.scala:16)
[error] at scala.util.PropertiesTrait$class.$init$(Properties.scala:77)
[error] at scala.util.Properties$.<init>(Properties.scala:16)
[error] at scala.util.Properties$.<clinit>(Properties.scala)
[error] at scala.compat.Platform$.<init>(Platform.scala:112)
[error] at scala.compat.Platform$.<clinit>(Platform.scala)
[error] at scala.App$class.$init$(App.scala:42)
[error] at edu.knowitall.openie.OpenIECli$.<init>(OpenIECli.scala:29)
[error] at edu.knowitall.openie.OpenIECli$.<clinit>(OpenIECli.scala)
[error] at edu.knowitall.openie.OpenIECli.main(OpenIECli.scala)