Forum Discussion

Jan_Stepan's avatar
Jan_Stepan
Occasional Contributor
16 years ago

Any ideas why loading properties file results in "Access is denied"

I posted this question in a properties thread, but may be this should be a new topic. I'm using soapUI 2.5.1.

I've tried to use a groovy script to load test suite properties. The same code in a groovy step and in the test suite startup script results in  ERROR:java.io.FileNotFoundException "Access is denied".

I'm running XP and have admin rights on the PC.

The code I've tried is


def findwindowsProperties = new java.util.Properties();
findwindowsProperties.load( new java.io.FileInputStream( "C:/Temp" + context.expand('${#TestSuite#Properties.txt}' ) ));


The error log is

Wed Mar 11 14:45:12 PDT Wed Mar 11 15:14:52 PDT 2009:ERROR:java.io.FileNotFoundException: C:\Temp (Access is denied)
  java.io.FileNotFoundException: C:\Temp (Access is denied)
  at java.io.FileInputStream.open(Native Method)
  at java.io.FileInputStream.<init>(Unknown Source)
  at java.io.FileInputStream.<init>(Unknown Source)
  at sun.reflect.GeneratedConstructorAccessor33.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at org.codehaus.groovy.runtime.MetaClassHelper.doConstructorInvoke(MetaClassHelper.java:595)
  at groovy.lang.MetaClassImpl.doConstructorInvoke(MetaClassImpl.java:2359)
  at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1255)
  at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1185)
  at org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(InvokerHelper.java:809)
  at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNewN(ScriptBytecodeAdapter.java:230)
  at Script21.run(Script21.groovy:2)
  at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:59)
  at com.eviware.soapui.impl.wsdl.WsdlTestSuite.runSetupScript(WsdlTestSuite.java:461)
  at com.eviware.soapui.impl.wsdl.panels.testsuite.WsdlTestSuiteDesktopPanel$SetupScriptGroovyEditorModel$1.actionPerformed(WsdlTestSuiteDesktopPanel.java:502)
  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
  at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
  at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
  at java.awt.Component.processMouseEvent(Unknown Source)
  at javax.swing.JComponent.processMouseEvent(Unknown Source)
  at java.awt.Component.processEvent(Unknown Source)
  at java.awt.Container.processEvent(Unknown Source)
  at java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.run(Unknown Source)
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Jan,


    Are you running soapUI using Web Start?
    Can you also post your system properties (available through Help->System Properties)?


    Cheers!
    /Nenad Nikolic a.k.a. Shonzilla
  • Jan_Stepan's avatar
    Jan_Stepan
    Occasional Contributor
    I seem to have the same issue with both the stand-alone version and the web-start version.  Here are the properties from the stand-alone version.


    apple.laf.useScreenMenuBar=true

    awt.toolkit=sun.awt.windows.WToolkit

    com.apple.mrj.application.apple.menu.about.name=SoapUI

    file.encoding=Cp1252
    file.encoding.pkg=sun.io
    file.separator=\

    java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
    java.awt.printerjob=sun.awt.windows.WPrinterJob
    java.class.path=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\soapui-2.5.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\activation-1.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\bcprov-jdk15-141.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\binding-2.0.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\commons-beanutils-1.7.0.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\commons-cli-1.0.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\commons-codec-1.3.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\commons-collections-3.2.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\commons-httpclient-3.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\commons-io-1.3.2.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\commons-lang-2.4.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\commons-logging-1.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\ext-xmlbeans-1.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\ezmorph-1.0.5.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\forms-1.0.7.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\groovy-all-1.5.7.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\j2ee-xmlbeans-1.4.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\javamail-1.4.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\jetty-6.1.14.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\jetty-util-6.1.14.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\json-lib-2.2.2-jdk15.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\jsr173_1.0_api-xmlbeans-2.4.0.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\jtidy-8.0-SNAPSHOT.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\junit-4.4.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\l2fprod-common-fontchooser-0.2-dev.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\log4j-1.2.14.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\looks-2.2.0.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\not-yet-commons-ssl-0.3.10.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\opensaml-1.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\policy-xmlbeans-1.5.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\rsyntaxtextarea-1.0-soapui.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\saxon-9.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\saxon-dom-9.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\servlet-api-2.5-6.1.14.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\soap-xmlbeans-1.2.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\soapui-xmlbeans-2.5.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\swingx-soapui.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\wadl-xmlbeans-1.0.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\wsdl4j-1.6.2-fixed.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\wss4j-1.5.5.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\xalan-2.7.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\xbean-fixed-2.4.0.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\xbean_xpath-2.4.0.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\xercesImpl-2.9.1.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\xmlpublic-2.4.0.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\xmlsec-1.4.2.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\xmlunit-1.2.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\..\lib\xom-1.1.jar;
    java.class.version=50.0
    java.endorsed.dirs=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\lib\endorsed
    java.ext.dirs=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
    java.home=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre
    java.io.tmpdir=C:\DOCUME~1\jstepan\LOCALS~1\Temp\
    java.library.path=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;c:\oracle\product\11.1.0\client_1;c:\oracle\product\11.1.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Diskeeper Corporation\Diskeeper\;C:\Program Files\Hummingbird\Connectivity\10.00\Accessories\;;C:\Program Files\Rational\common;C:\Program Files\Rational\ClearCase\bin
    java.runtime.name=Java(TM) SE Runtime Environment
    java.runtime.version=1.6.0_10-b33
    java.specification.name=Java Platform API Specification
    java.specification.vendor=Sun Microsystems Inc.
    java.specification.version=1.6
    java.vendor=Sun Microsystems Inc.
    java.vendor.url=http://java.sun.com/
    java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi
    java.version=1.6.0_10
    java.vm.info=mixed mode
    java.vm.name=Java HotSpot(TM) Client VM
    java.vm.specification.name=Java Virtual Machine Specification
    java.vm.specification.vendor=Sun Microsystems Inc.
    java.vm.specification.version=1.0
    java.vm.vendor=Sun Microsystems Inc.
    java.vm.version=11.0-b15

    line.separator=


    os.arch=x86
    os.name=Windows XP
    os.version=5.1

    path.separator=;

    soapui.ext.actions=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\actions
    soapui.ext.libraries=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\ext
    soapui.ext.listeners=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\listeners
    soapui.home=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin\
    soapui.properties=soapui.properties

    sun.arch.data.model=32
    sun.boot.class.path=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\lib\resources.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\lib\rt.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\lib\sunrsasign.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\lib\jsse.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\lib\jce.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\lib\charsets.jar;C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\classes
    sun.boot.library.path=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\jre\bin
    sun.cpu.endian=little
    sun.cpu.isalist=
    sun.desktop=windows
    sun.io.unicode.encoding=UnicodeLittle
    sun.java.launcher=SUN_STANDARD
    sun.jnu.encoding=Cp1252
    sun.management.compiler=HotSpot Client Compiler
    sun.os.patch.level=Service Pack 2

    user.country=CA
    user.dir=C:\Documents and Settings\jstepan\My Documents\Tools\soapUI\soapui-2.5.1\bin
    user.home=C:\Documents and Settings\jstepan
    user.language=en
    user.name=jstepan
    user.timezone=America/Los_Angeles
    user.variant=
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    it seems the context.expand(..) is actually returning an empty string which results in the file being c:\temp.. do you have a property named properties.txt defined at the testsuite level?

    regards!

    /Ole
    eviware.com
  • Jan_Stepan's avatar
    Jan_Stepan
    Occasional Contributor
    We've relosved this in the other post. To load a file the code should be

    def findwindowsProperties = new java.util.Properties();
    findwindowsProperties.load( new java.io.FileInputStream( "C:/Temp/Properties.txt" + context.expand('${#TestSuite#Properties.txt}' ) ));


    Thanks in advance for help with other questions I will have in the future.