dropwizard no injection source found for a parameter error - dropwizard

I am new to Dropwizard i created a sample dropwizard maven project in eclipse followed this dropwizard tutorial dropwizard tutorial . I am able to build the project however while running the project with command
java -jar target/hello-world-0.0.1-SNAPSHOT.jar
it gives this error
No injection source found for a parameter of type public dropWizardSample.Saying dropWizardSample.HelloWorldResource.sayHello(jersey.repackaged.com.google.common.base.Optional) at index 0
Any help ??

I haven't seen this error but I see a basic problem with the command you are executing:
java -jar target/hello-world-0.0.1-SNAPSHOT.jar
should be
java -jar target/hello-world-0.0.1-SNAPSHOT.jar server

The complete command to execute should be
java -jar target/hello-world-0.0.1-SNAPSHOT.jar server hello-world.yml
in which the parameters
server specifies you are trying to run an application and
hello-world.yml is the file where you specify the configuration for your application.

Related

Error running Grails 3 application on CMD

I am new to Grails and never made any project on it. I followed some tutorials and downloaded both Grails and JDK and set my environment variables exactly as specified, but when I tried to run the application, I got this error and my application is not running:
Error initializing classpath: could not determine java version from '10.0.2'
I just used CMD and none of the IDE is used, please help me solve this problem.
First check classpath of both for Java & Grails by running these command java -version & grails -version
If you found problem in classpath then solve by this way http://grails.asia/grails-tutorial-for-beginners-setup-your-windows-development-environment/
Although its better to use Java 8, not Java 10

creating jhipster-spring boot project war file error

I have an jhipster-spring boot application which is running docker. I want to create war file. I found some commands here:
https://jhipster.github.io/production/
When I type ./mvnw -Pdev package .I am typing this command in intellij terminal. I am getting this error: http://paste.ubuntu.com/23082073/
I have no idea what is it because normally my app is running correcty. What I need for creating war? Should I connect database? There is no more info in above link.
Thanks
from the logs that you pasted, it looks an error from spring and hibernate. check if the connections to database are working, check if your database is setup correctly as in the logs found this
Wrong column type in FRAUD.PUBLIC.MODEL_WEIGHT for column weight. Found: double, expected: real
after that use the command ./mvnw -Pprod package to generate the WAR file.
Hope this helps.

Grails: how to define configuration profile when launching grails war with java command?

I have a grails 3.0 application packaged as war file, and I would like to run it with java command line. Things looks simple from the reference guide: java -jar my_war_file_name. But I cannot find a way to pass in the profile (dev/test/prod), and also it looks like -D option cannot overwrite the configuration as well. Any idea?
Best Regards
Sorry, I found the problem. I should put -D in front of -jar. So this is working:
java -Dgrails.env=prod -Dserver.port=xxxx -jar my_war_file

Using Jenkins' Testlink plugin

Hi i'm trying to implement testlink plugin in jenkins.
I followed this tutorial http://tupilabs.com/books/jenkins-testlink-plugin-tutorial/en/book.pdf
I can build the project but the test isn't run.
there is a file not found error
I don't understand where i have to put my testfile. I supposed the output format must be TestNG, but where i have to put it ?
Thanks for your answer
I had exactly the same problem with building project, when I was following through tutorial placed in book Jenkins:The Definitive Guide.
I had Jenkis (jenkins-1.502.msi) instaled on Windows7 64 as a service - whatever I tried always received:
[workspace] $ mvn.bat
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "mvn.bat" (in directory "C:\Work\jenkins\jobs\gameoflifedefault\workspace"): CreateProcess error=2, The system cannot find the file specified
Unfortunately I didn't managed to resolve this jenkis service problem but found another solution to make it work on Windows:
Use Apache Tomcat java server - if you have properly configured Tomcat do:
Download jenkins.war
Place it in webapps folder in your Tomcat directory
Run Tomcat and check via http://localhost:8080/manager if jenkins is there
Go to http://localhost:8080/jenkins
Now mvn.bat is seen and my build run without problems.
Ofcourse I understand that maven is properly configured on your system - so you should had specified in environmental variables:
variable: M2
value: %M2_HOME%\bin
variable: M2_HOME
value: C:\yourPathToMaven\apache-maven-3.0.4
variable: PATH
add to existing value: %M2_HOME%;
To check if maven is visible type in comand promp:
C:\Users\x>mvn --version
You should get something like:
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: C:\Work\Maven\apache-maven-3.0.4
Java version: 1.7.0, vendor: Oracle Corporation
Java home: C:\Work\ja\jdk1.7.0_10\jre
Default locale: en_US, platform encoding: Cp1250
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Hope it helps.
Update : I found that the error was :
Cannot run program mvn.bat in directory d:/jenkins/jobs/JobTest/workspace CreateProcess error=2 File not found.
I made a free style project as said in the tutorial. It seems to be a maven error so i don't understand ...
If somebody can help me i'd be gratefull

Error in running RMIC via Ant using wsejbdeploy taskdef

I get the following exception when trying to generate RMIC using Ant task.
[wsejbdeploy] Error generating RMI code: RMIC command failed on project: .... with message:
[wsejbdeploy] error: The IBM RMIC version 0x1500 does not match the IBM runtime version 0x1600.
Please let me know how to fix this.
I am trying this using the WebSphere 6.1 server that comes bundled with RAD7.5.
This works fine when we use IDE to generate the EAR, and fails only when we use our custom Ant build file.
The error means that JAVA_HOME in your shell used to invoke Ant is different from the Java that was included with the embedded WebSphere Application Server. Try using the WAS_HOME/bin/ws_ant script, or set JAVA_HOME to WAS_HOME/java/.
The error
Cannot run RMIC because it is not installed. Expected location of RMIC is the following:
will some times confuse. enable the "Capture RMIC verbose output to the workspace .log file.
and see what the exact error your getting. This option will be available in properties > EJBDeployment.
In My case it throwing error due to huge number of jars in class path.It got resolved after shortening the class path jar location.

Resources