when we run a Rhapsody application via Jenkins.
My scenario:
1) I need to get details about various diagrams in a Rhapsody model.
2) I have written Java code using api provided by Rhapsody to get the details of various diagrams.
3) this java code is made into Jar and is run via command line, works fine by invoking Rhapsody in background.
4) when this same command is put in jenkins to run as windows command, the job fails,
The code is able to connect to Rhapsody Instance, but somehow unable to open a project.
Did anyone resolve this type of issue ??
Yes I faced this issue when running a plugin in jenkins where I was not able to open the rhapsody instance as it was throwing an examption.
To solve make user which runs the jenkins job has the license for rhapsody if yes try to open your rhapsody project manually and run the script from the job.
Hope these solution works for you
Related
I have been given the task of developing code that generates an email when a user deploys new code to our servers. I already have the code to generate the email. However Im trying to run this code when we add new code to our servers. We currently deploy new code to our servers using the MAVEN Deploy command in Eclipse. I was wondering if there is a way to run a java main method or something along those lines when a user selects Maven Deploy in Eclipse?
Not sure of your actual use case or if this is the best approach, but you can run java programs using the maven exec plugin. See here for more details: http://www.mojohaus.org/exec-maven-plugin/examples/example-exec-for-java-programs.html
I'm just starting with App Engine, and am trying to get a basic Hello World running locally on my machine to test. I've been trying to follow the tutorial for Java here.
I get as far as running the following commands:
cd appengine-try-java
mvn package
At which point the tutorial insists that the server should be built and run and I should be ready to go, except I just get a "build success" and the server isn't running (The terminal output doesn't hang and wait for Ctrl+C, and I can't access localhost:8080).
I've tried figuring out myself how to use the .war file it gives me to run the server using the Apache Maven, but without any luck. I followed the rest of the tutorial exactly. Any advice on what I'm missing?
Thanks!
I think you forgot to run the last command:
dev_appserver.sh target/appengine-try-java-1.0
with cd you go to the folder, with mvn package you will build the project and with the dev_appserver.sh you will start the actual project.
I've written an Android app that works fine running in Eclipse with an
Android simulator.
However, a portion of the program is purely computational, and I'd
like to unit test that portion in a command window using "javac" and
"java" commands, using "System.out.print" to get output. Is there any
simple way to do that, without copying all the source files from the
Eclipse workspace into another directory?
Alternatively, I've tried to do something similar under Eclipse:
I wrote a program "UnitTest.java" that calls the computational
code, and everything compiles correctly. UnitTest.java contains a
"main" program.
I created a new "Debug Configuration" -- UnitTest as a Java
application.
In the JRE tab, I pointed the Runtime JRE to the "Alternate JRE",
which is jdk1.7.0_13 in C:\Program Files\Java\jdk1.7.0_13.
However, when I try to run it, I get: Cannot connect to VM Socket
operation on nonsocket: configureBlocking
I'm still able to run the Android app when I launch the original
configuration.
The ideal situation is that I would be able to run either the Android
app or the unit test as either a Java app in Eclipse or as a command
line app in Windows.
Is there any way to do this, or am I asking for the moon?
Im following the tutorial on the App Engine website for 'Google Cloud Endpoints' in Java. Everything works fine and I can run the development server using mvn appengine:devserver. The problem is that when I make any changes to a file (for example, any java file) the dev server doesnt automatically recompile. I need to ctrl-c to kill the dev server and restart it for every code change I make.
Is there a way to have maven automatically detect changes to any files in my project and have it automatically rebuild and restart the dev server?
Unfortunately no. If you want this behavior on your dev server, you need to use Python.
I run in the same issue and there is no real workaround provided by the App Engine to help you doing this.
From the "Using The Google plugin for Eclipse":
With Eclipse, you can leave the server running in the debugger while you make changes to source code, JSPs, static files and appengine-web.xml. When you save changes to source code, Eclipse compiles the class automatically, then attempts to insert it into the running web server dynamically. In most cases, you can simply reload the page in your browser to test the new version of the code. Changes to JSPs, static files and appengine-web.xml are recognized by the development server automatically, and also take effect without restarting the server. If you change web.xml or other configuration files, you must stop and start the server for the changes to take effect.
(https://developers.google.com/appengine/docs/java/tools/eclipse#Running_the_Project)
There is NOTHING comparable in Java (link from "The Java Development Server") (https://developers.google.com/appengine/docs/java/tools/devserver)
There's currently nothing in the App Engine SDK to automatically restart when files change, but that's not to say you can't do it. I ran into the same problem and wrote up a script to listen for file changes as triggers to restart App Engine. It's in JavaScript, so you'll need to install Node.js if you haven't already.
// Install watch-exec
$ npm install -g watch-exec
// Watch the current directory
$ watch-exec --command "mvn appengine:devserver" --watch .
This will immediately start App Engine, and then restart it any time a file changes. If the app crashes for some reason, the script will wait for your next edit before trying to restart.
P.S. That entire script is about 40 lines of code, and you could probably do the same thing in other scripting languages. If you haven't tried writing your own automation before, I'd definitely recommend checking out the source code to see how this works.
I've found using Gradle, GAE, and Spring MVC, the assemble command will put the correct artifacts in place, and the server will re-init the app. It's a little quicker than a server restart.
Using App Engine standard with the cloud.tools appengine-maven-plugin hot swap works fine (most of the time, can be problems when setting up the workspace).
For a multi-module maven project: no need to stop the server or browser,
just push the code changes (maven command package -pl *-server)
& refresh the browser.
Debugging with a debug client currently works perfectly for changing / adding code within methods.
I am following this tutorial:
https://spring.io/guides/gs/rest-service/
After completing the tutorial I run everything in my web browser on my local host and everything seems to work.However when I make changes in the java code (I made errors on purpose) I can still run everything in the web browser. What do I need to do in order for it to change due to my code changes? I guess I should mention that I am using eclipse and have installed maven as a plugin.
You are changing the source code, but not the compiled files. Your service is using the created "gs-rest-service-0.1.0.jar" file. This is not affected by your code changes.
Jump into the tutorial again where it says:
"Build an executable JAR"
This will rebuild your jar file. Afterwards you will have to restart your service like you did in the chapter "Run the service".
Instead of using maven as a plugin a choose to install it in order to use the command prompt.