tobyweston / radiate

Build monitor for TeamCity written in Scala
Apache License 2.0
14 stars 3 forks source link

"A Java Exception has occurred." #33

Closed vorou closed 8 years ago

vorou commented 9 years ago

I've tried running both .jar and .exe, both results into the exception.

Windows 8.1 x64 java version "1.7.0_60" radiate-1.0-20140618.062538-15.exe

tobyweston commented 9 years ago

Have you set the env variable to point to your teamcity? Can you see anything in the log file? It should be in your user.home folder... the other thing it's Java 8 only

vorou commented 9 years ago

Yep, I set url to https://path-to-tc and port to 443. I couldn't find the log, and couldn't find any logging activity in the process monitor log either. Here's the full procmon log, in case it may help.

tobyweston commented 9 years ago

Try running on Java 8, then you should see a file (radiate.log I think) get created in the user home folder.

vorou commented 9 years ago

The file is there (~\.radiate\radiate.log), but it's empty.

tobyweston commented 9 years ago

Ok, let me know if upgrading to Java 8 helps

vorou commented 9 years ago

Sorry, didn’t make it clear. It happened after I updated to Java 8.

Viktor

From: Toby Sent: ‎Tuesday‎, ‎November‎ ‎18‎, ‎2014 ‎1‎:‎00‎ ‎AM To: tobyweston/radiate Cc: vorou

Ok, let me know if upgrading to Java 8 helps

— Reply to this email directly or view it on GitHub.

tobyweston commented 9 years ago

Hmmm, not sure. Has a config file been created? It should be config.yml in a folder called .radiate under your user home.

I've not tested under windows 8.

You mentioned an exception, what's shown? Do you see a stack trace? Could you list it or take a screen grab?

Andrea commented 9 years ago

Having the same issue here and can't find a .radiate file (tried with the exe and the screensaver file), tho this build radiate-1.0-20140313.124506-10.scr worked but it doesn't seem to create the config.yml file :cry: :crying_cat_face:

it might be handy to add full path information as to where to find the config.yml?

 2015-05-04 16:10:39,286 ERROR [AllProjectsAsSingleTask] Please set environment variable 'TEAMCITY_HOST'
java.lang.IllegalArgumentException: Please set environment variable 'TEAMCITY_HOST'
    at bad.robot.radiate.Environment.getEnvironmentVariable(Environment.java:9)
    at bad.robot.radiate.teamcity.BootstrapServer.<init>(BootstrapServer.java:9)
    at bad.robot.radiate.teamcity.BootstrapTeamCity.<init>(BootstrapTeamCity.java:6)
    at bad.robot.radiate.teamcity.AllProjectsAsSingleTask.create(AllProjectsAsSingleTask.java:15)
    at bad.robot.radiate.MonitoringTasks.<init>(MonitoringTasks.java:25)
    at bad.robot.radiate.Application.start(Application.java:21)
    at bad.robot.radiate.Main.main(Main.java:6)
2015-05-04 16:10:39,291 INFO  [AllProjectsAsSingleTask] Restart required
2015-05-04 16:10:39,291 ERROR [AllProjectsAsSingleTask] Nothing found to monitor, check your configuration
bad.robot.radiate.monitor.NothingToMonitorException: Nothing found to monitor, check your configuration
    at bad.robot.radiate.MonitoringTasks.<init>(MonitoringTasks.java:31)
    at bad.robot.radiate.Application.start(Application.java:21)
    at bad.robot.radiate.Main.main(Main.java:6)
tobyweston commented 9 years ago

So the config.yml file will be found under the user.home folder. I'll add something in the log to show the full path.

In the meantime, from the stack trace above, it looks like you're not setting an environment variable for TEAMCITY_HOST. Set it to the hostname of the teamcity server (ie localhost), no need for http://localhost. Set the port using TEAMCITY_PORT if it's not the default of 8111. That's the minimum setup it needs. Once you've set one to point to your teamcity install, it'll scan the projects and create the config.

ps, try radiate-1.0-20140618 (v15) until then...

Andrea commented 9 years ago

Thanks for the response :D :+1:

So the config.yml file will be found under the user.home folder. I'll add something in the log to show the full path. well, not there :D

In the meantime, from the stack trace above, it looks like you're not setting an environment variable for TEAMCITY_HOST.

Editing the help now so this is more obvious on the readme file When I do add the host and port I get this error My environment settings are localhost for the host and port is 80

Failed to create Yml configuration file (caused by an UnexpectedResponse Unexpected HTTP response from http://localhost/:80/guestAuth/app/rest/projects (404, Not Found)), falling back to use environment variables
Unexpected HTTP response from http://localhost/:80/guestAuth/app/rest/projects (404, Not Found) when monitoring monitoring unknown as a single aggregate

Set it to the hostname of the teamcity server (ie localhost), no need for http://localhost. Set the port using TEAMCITY_PORT if it's not the default of 8111. That's
the minimum setup it needs. Done this but it still doesn't work, Once you've set one to point to your teamcity install, it'll scan the
projects and create the config.

ps, try radiate-1.0-20140618 (v15) until then...

this is the one that fails with "A Java exception has occurred " so nope :(

tobyweston commented 9 years ago

Thanks for the pull request.

It looks like your URL http://localhost/:80/guestAuth/app/rest/projects might be funny. It should look like http://localhost:80/guestAuth/app/rest/projects. Have you included a colon in the config? To override the port, just use the value 80, and not :80 in the environment variable. Also, it probably doesn't work if you include the port in the TEAMCITY_HOST variable, it needs to go in the TEAMCITY_PORT one.

hmmm... I just did a quick test and you'd get a different error than you're reporting if you'd misconfigured it like that... did you put a trailing slash after localhost in TEAMCITY_HOST? Is your TeamCity setup with guest authorisation for the REST API? What version of TeamCity is it?

What it will do if it can connect to your TeamCity is generate the config.yml and record what it's discovered; the project names etc. It will also list in the log where the file was created if you press F1.

tobyweston commented 9 years ago

A quick google, and I found a couple of public TeamCity instances. You could test it out but pointing to one of these. ie,

TEAMCITY_HOST=teamcity.bryntum.com TEAMCITY_PORT=80

This is how I set them from my IDE, not there's no protocol or anything. I just fired it up and it connects ok. I'll create a new JAR just in case something was missed from the last one as soon as I can find a Windows machine (for the .exe).

screen shot 2015-05-05 at 18 32 01

tobyweston commented 9 years ago

Did you manage to get things running? I'll close the issue if so.

vorou commented 9 years ago

Running these two, no luck:

radiate-1.0-20140618.062538-15.exe
radiate-1.0-20140618.062538-15.jar

I've set the vars as you said:

TEAMCITY_HOST=teamcity.bryntum.com
TEAMCITY_PORT=80

Only empty radiate.log is created in ~\.radiate. I'm on Windows 10 x64, Java 1.8.0_51.

tobyweston commented 9 years ago

hmm, sorry to hear that. I'm preparing a new version with some other tweaks and better error reporting. I suggest we have a go with that when it's ready.

tobyweston commented 8 years ago

Fixed in v2.0