Attempting to start Bamboo 4.4.3 using Jetty results in a NullPointerException
Asked by Andrew Schneider:

I followed the instructions on this page:

<https://confluence.atlassian.com/display/BAMKB/Running+bamboo+behind+apache+httpd+proxy>

To get bamboo proxied behind an Apache HTTP server. I've configured Apache appropriately (using it for our other servers) and modified the conf/wrapper.conf file as specified in the documentation. However, when I call wrapper/start-bamboo start and tail the logs/bamboo.log, I get the following exception:

Loading jetty configuration file 'webapp/WEB-INF/classes/jetty.xml' from the classpath as it does not exist on the filesystem.

java.lang.NullPointerException

at org.eclipse.jetty.xml.XmlConfiguration.(XmlConfiguration.java:150)

at com.atlassian.bamboo.server.Server.(Server.java:141)

at com.atlassian.bamboo.server.Server.main(Server.java:46)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)

at java.lang.Thread.run(Unknown Source)

If I change everything back to standard, it works as expected.


Answers:
author: Adam Myatt
body: Check the wrapper.conf file again. I use the same setup (reverse proxying with apache httpd) and my wrapper.conf has these initial lines :

wrapper.app.parameter.1=com.atlassian.bamboo.server.Server  
wrapper.app.parameter.2=webapp/WEB-INF/classes/jetty.xml

<br />

#wrapper.app.parameter.2=8085  
#wrapper.app.parameter.3=../webapp  
#wrapper.app.parameter.4=/

Make sure you comment out any other lines with "wrapper.app.parameter.X" as the PORT, PATH to the jetty file, and Content (/) get specified in the jetty XML. and that the numbers are sequential.

Additionally double-check how you're starting Bamboo. If you use the bamboo.sh file, has it been modified or moved? It includes the wrapper.conf info using :

$BAMBOO_INSTALL/conf/wrapper.conf

where $BAMBOO_INSTALL is built from the directory of the bamboo.sh file. If that file gets moved it can affect the env variables and the wrapper.conf file cannot resolve the path webapp/WEB-INF/classes/jetty.xml correctly.

If your HTTPD reverse proxy is serving via SSL, in the jetty.xml make sure to include :

\<Call name="addConnector"\>  
\<Arg\>  
\<New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector"\>  
\<Set name="host"\>\<Property name="jetty.host" /\>\</Set\>  
\<Set name="port"\>\<Property name="jetty.port" default="8443"/\>\</Set\>  
\<Set name="Keystore"\>\<SystemProperty name="jetty.home" default="."/\>/ssl/keystore\</Set\>  
\<Set name="Password"\>KEYPASS\</Set\>  
\<Set name="KeyPassword"\>KEYPASS\</Set\>  
\</New\>  
\</Arg\>  
\</Call\>

You need to generate a local keystore on the bamboo server and inside it generate a self-signed cert with password and keypass that you define in the addConnector XML above (replace KEYPASS with your password). This seems to be necessary to get Bamboo to listen on an SSL port and then you update your Apache conf file to proxypass an dproxypassreverse to the bamboo SSL port. If you don't then Bamboo breaks in the SSL reverse proxy config.