'SoapUI Build War file

I have xml project created by the SOAPUI. And I need to generate a war file using Java.

I found the classes that provide this functionality, but when you create a war file, I get an error.

soapUI 4.5.1-SNAPSHOT War Generator
18:30:27,415 INFO  [DefaultSoapUICore] initialized soapui-settings from [/home/natrix82567/soapui-settings.xml]
18:30:27,891 INFO  [WsdlProject] Loaded project from [file:/home/natrix82567/Документы/mw-bpweb-auto-07-nc-pb-soapui-project.xml]
18:30:28,141 INFO  [WsdlProject] Saved project [api] to [/tmp/api-project.xml - 111525 bytes
18:30:28,142 INFO  [SoapUIMockAsWarGenerator] Creating WAR file with endpoint [api]
18:30:28,145 INFO  [MockAsWar] Creating WAR directory in [/home/natrix82567]
18:30:28,146 ERROR [JarPackager] /home/natrix82567/My individual project/trunk/TaskSoapUI/../lib or /home/natrix82567/WEB-INF/lib is not directory!
18:30:28,147 INFO  [SoapUIMockAsWarGenerator] WAR Generation complete
Exception in thread "SwingWorker" java.lang.NullPointerException
    at java.io.File.<init>(File.java:222)
    at com.eviware.soapui.tools.MockAsWar.prepareWarFile(MockAsWar.java:214)
    at com.eviware.soapui.tools.MockAsWar$1.construct(MockAsWar.java:90)
    at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
    at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
    at java.lang.Thread.run(Thread.java:662)

Actually the question was, why he does not see the folder WEB-INF directory as and fall NullPointerException ?



Solution 1:[1]

There was a bug with the WAR generation in SoapUI 4.6.1. The bug is fixed in 4.6.2 and can be downloaded from http://www.soapui.org/

Hopefully this will solve your problem.

Solution 2:[2]

With SoapUI 5.7.0, NullPointerExcpetion if missing one of the 2 required arguments.

Command line example:

wget https://dl.eviware.com/soapuios/5.7.0/SoapUI-5.7.0-linux-bin.tar.gz
tar -xzf SoapUI-5.7.0-linux-bin.tar.gz
chmod a+x ./SoapUI-5.7.0/bin/*.sh 
./SoapUI-5.7.0/bin/wargenerator.sh -d . -f soapui_mock_services.war soapui_mock_services_soapuiproject.xml

FYI: Command line args

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2