Forum Discussion

SoapUIAmateur's avatar
SoapUIAmateur
New Contributor
12 years ago

Soapui 4.6.1 IllegalArgumentException

Hi guys,

I have managed to deploy the project as war and deployed in TomCat8. Unfortunately when I tried to access the service in Tomcat it throws the following exception:

26-Nov-2013 13:41:14.967 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 26042 ms
26-Nov-2013 13:48:54.527 INFO [http-apr-8080-exec-5] null.null Listeners not set!
26-Nov-2013 13:48:54.529 INFO [http-apr-8080-exec-5] com.eviware.soapui.mockaswar.MockAsWarServlet.initMockServiceParameters Actions not set!
26-Nov-2013 13:48:54.861 INFO [http-apr-8080-exec-5] com.eviware.soapui.mockaswar.MockAsWarServlet.initMockServiceParameters Init settings
26-Nov-2013 13:48:54.877 SEVERE [http-apr-8080-exec-5] com.eviware.soapui.mockaswar.MockAsWarServlet.init null
java.lang.IllegalArgumentException
at org.apache.catalina.webresources.AbstractResourceSet.checkPath(AbstractResourceSet.java:41)
at org.apache.catalina.webresources.DirResourceSet.getResource(DirResourceSet.java:91)
at org.apache.catalina.webresources.StandardRoot.getResourceInternal(StandardRoot.java:176)
at org.apache.catalina.webresources.CachedResource.validate(CachedResource.java:62)
at org.apache.catalina.webresources.Cache.getResource(Cache.java:80)
at org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:163)
at org.apache.catalina.core.StandardContext.getRealPath(StandardContext.java:4516)
at org.apache.catalina.core.ApplicationContext.getRealPath(ApplicationContext.java:398)
at org.apache.catalina.core.ApplicationContextFacade.getRealPath(ApplicationContextFacade.java:335)
at com.eviware.soapui.mockaswar.MockAsWarServlet$MockServletSoapUICore.<init>(MockAsWarServlet.java:237)
at com.eviware.soapui.mockaswar.MockAsWarServlet.initMockServiceParameters(MockAsWarServlet.java:133)
at com.eviware.soapui.mockaswar.MockAsWarServlet.init(MockAsWarServlet.java:72)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1235)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:830)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:137)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:107)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:76)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:934)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:90)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:515)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1012)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:642)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:282)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2461)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2450)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

It looks like the exception is thrown at:

if( StringUtils.hasContent( getInitParameter( "soapuiSettings" ) ) )
116 {
117 logger.info( "Init settings" );
118 SoapUI.setSoapUICore( new MockServletSoapUICore( getServletContext(), getInitParameter( "soapuiSettings" ) ),
119 true );
120 }

I suspect something to do with the init parameters in web.xml and tried all sort of [soapuiSettings] or [SoapUISettings] or [soapUISettings] but none work.

Any help please !

Thanks

SoapUIAmateur

6 Replies

  • Hi,

    I haven't tested deploying a mock WAR in Tomcat, but there is no general problem with mock WARs, as far as I know. I just used one to test a solution for a Pro support ticket.

    In fact, the error is on line 237 in the Java file, where the mock app asks Tomcat for the real location of the root of the web application and the SoapUI settings file. Tomcat throws an error. This may be because your WAR is broken, for whatever reason, but may also be due to some configuration in Tomcat. I don't believe it's a bug in SoapUI, however.

    Hope this helps!

    Manne,
    SmartBear support
  • Thanks guys

    I did follow those links suggested to fix the war generation process.

    However, the web.xml file generated the relative path files to projectFile and SoupUISettings missing a forward slash in front in order for Tomcat 8.0 resolve the path :

    <init-param>
    <description>project file path</description>
    <param-name>projectFile</param-name>
    <param-value>WEB-INF/soapui/BMS-soapui-project.xml</param-value>
    </init-param>
    <init-param>
    <description>global settings file</description>
    <param-name>SoapUISettings</param-name>
    <param-value>WEB-INF/soapui/soapui-settings.xml</param-value>
    </init-param>

    After changing the <param-value>/WEB-INF/soapui/BMS-soapui-project.xml</param-value> and <param-value>/WEB-INF/soapui/soapui-settings.xml</param-value> it works.

    Cheers

    SoapUIAmateur
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    Hi SoapUIAmateur
    thanks for your feedback
    There were no problems with the web.xml file when deploying in previous version of tomcat. This should work out of the box with tomcat 7 for instance. Could you confirm?

    As Tomcat 8 is still in RC mode, maybe this is an issue in tomcat; do you have any information about this?
  • Hi redfish4ktc2

    We are using Tomcat 8. Some discussions related to this issue mentioned few alternative ways of setting up the Context parameters in their configuration. I didn't seem to get it work either. When I returned to the web.xml file and tried with the "/" in the param-value for the projectFile and soapUISettings, it worked. I moved on with the work and didn't get into any further research.

    Cheers

    SoapUIAmateur