# The system variables passed to java class doesnt work in gatling simulation

**URL:** <https://community.gatling.io/t/the-system-variables-passed-to-java-class-doesnt-work-in-gatling-simulation/4414>\
**Category:** Gatling (Open-Source)\
**Created:** [July 6, 2018, 8:08pm UTC](https://community.gatling.io/t/the-system-variables-passed-to-java-class-doesnt-work-in-gatling-simulation/4414 "2018-07-06T20:08:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanhita\_bs](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@Sanhita\_bs](https://community.gatling.io/u/Sanhita_bs)\
**Post date:** [July 6, 2018, 8:08pm UTC](https://community.gatling.io/t/the-system-variables-passed-to-java-class-doesnt-work-in-gatling-simulation/4414/1 "2018-07-06T20:08:17Z")

</div>

Hi,

I have the following simulation class in gatling:

class BasicSimulation extends Simulation {

var p= new SmokeTest();  
println(p.extractDeployerURI())

.baseURL(p.extractfunction()) // Here is the root for all relative URLs  
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8”) // Here are the common headers  
.acceptEncodingHeader(“gzip, deflate”)  
.acceptLanguageHeader(“en-US,en;q=0.5”)  
.userAgentHeader(“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0”)

.  
.  
.}

The extractfunction() is a method in a java class which extracts System variables and provides the base url as the output(which is a string). when the extractfunction() is run as a integration test, it passes. But it fails when called via the Simulation class.

Anybody who knows what can be done to solve this??

Thanks,  
Sanhita
