title: Jpos Q2 Server with Spring boot 2.3
body: <p>We have a existing system with Q2 Server and Spring MVC with following configuration.  Q2 server was created when a Httpservlet is initiated and It worked perfectly and spring beans can be autowired withn ISORequestlistner. This is now being converted to Spring boot 2.3. Once I initiated the same Httpservlet using ServletRegistrationBean in Spring boot, Q2 server is initiated and can send requst to it. But auto-wiring is not working. Once I check. Once he request is processing inside the ISORequest listner, Spring context is not visible since Q2 server is using different class loader.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;server class="org.jpos.q2.iso.QServer" logger="Q2" name="DownloadServer-A"&gt;
  &lt;attr name="port" type="java.lang.Integer"&gt;6400&lt;/attr&gt;
  &lt;attr name="minSessions" type="java.lang.Integer"&gt;10&lt;/attr&gt;
  &lt;attr name="maxSessions" type="java.lang.Integer"&gt;1100&lt;/attr&gt;
  &lt;channel name="DownloadServer-A-Channel" class="org.jpos.iso.channel.NACChannel" logger="Q2"
  packager="org.jpos.iso.packager.GenericPackager" header="6000010000"&gt;
  &lt;property name="packager-config" value="/app/repository/q2serverconfig/resources/Download_generic.xml" /&gt;
  &lt;/channel&gt;
  &lt;request-listener class="DownloadServerAListener" logger="Q2"&gt;
  &lt;property name="space" value="transient:default" /&gt;
  &lt;property name="queue" value="TransactionQueue" /&gt;
  &lt;property name="timeout" value="35000" /&gt;
  &lt;/request-listener&gt;
  &lt;/server&gt;</code></pre>
  </div>
  </div>
  
  1st Try
  Tried creating static ApplicationContext using ApplicationContextAware and tried it in the ISORequestListner. But It becomes null when TCP request received to Q2 server.</p>
  <p>2nd Try
  I tried several solutions like below github repo. But I didn't work.
  <a href="https://github.com/vmantek/chimera" rel="nofollow noreferrer">https://github.com/vmantek/chimera</a></p>
  <p>Have anyone tried to start ISO Server inside the Spring Application context as a bean?  What I mean is that start ISO Server in @Configuration class with using Q2.start(). Q2.start will start in a separate class loader. I don't want it to happen.</p>