Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a java file from grunt, doesnt open Port for Browserstack

I am running the BrowserStackTunnel.jar by the grunt plugin grunt-exec

(Have been using node's child_process.exec, but same results)

with the command java -jar BrowserStackTunnel.jar -force APIKEY localhost,8000,false

What the Java file actualy does is connecting via ssh to an Amazon instance of Browserstack and opening a port on 45691, the website of browserstack is polling that port on localhost where the Java application serves a small snippet containing the params passed.

If i run the command from the CLI it works fine and i see the port beeing open on netstat. In the browserstack website i get the success screen.

But if i run the command from grunt-exec it shows only the SYN request.

The output to the command line is the same, both show success

I am not so sure what is causing this. I am running on windows7, node v0.10.12, grunt-cli v0.1.9, grunt v0.4.1 and grunt exec v0.4.2

Any idea what is causing this or how to debug it? I thought about a permission problem, but i am kind of clueless

like image 321
pfried Avatar asked Oct 17 '13 07:10

pfried


People also ask

How to execute the jar on a particular port in Java?

Correct java command to execute the jar on a particular port is: java -Dserver.port=8888 -jar target/my-application-jar-path.jar The above command will run the JVM on the port 8888 but the below command java -jar target/my-application-jar-path.jar -Dserver.port=8888

How do I deploy a Java project with grunt?

But before deploying, you’ll need to configure the Java side of your project. You can use Grunt from Maven by adding the grunt-maven-plugin to your configuration. This plugin allows you to integrate Grunt tasks into the Maven build process.

How do I run a grunt task without specifying a task?

You can configure Grunt to run one or more tasks by default by defining a default task. In the following example, running grunt at the command line without specifying a task will run the uglify task. This is functionally the same as explicitly running grunt uglify or even grunt default.

How do I run a grunt file in Maven?

To add it, open your pom.xml file and add the follow code to the <project> element: This tells Maven to run the npm, which will prepare the environment, and grunt, which will run the automated tasks defined in your Gruntfile.js. Of course, you’ll need a Gruntfile.js file in order for this to work.


1 Answers

I had the same problem and I realized, better if I use the BrowserStackLocal binary files for creating a tunel. I solved a quite complex configuration here: Ember.js - CircleCI - BrowserStack

BrowserStackLocal files are here: http://www.browserstack.com/local-testing (Binaries)

like image 90
Zoltan Avatar answered Oct 09 '22 01:10

Zoltan