### Eclipse Workspace Patch 1.0
#P JSPWiki-2.8
Index: src/com/ecyrd/jspwiki/WikiEngine.java
===================================================================
--- src/com/ecyrd/jspwiki/WikiEngine.java	(revision 932040)
+++ src/com/ecyrd/jspwiki/WikiEngine.java	(working copy)
@@ -347,6 +347,7 @@
             catch( Exception e )
             {
                 context.log( "ERROR: Failed to create a Wiki engine: "+e.getMessage() );
+                log.error( "ERROR: Failed to create a Wiki engine, stacktrace follows " , e);
                 throw new InternalWikiException( "No wiki engine, check logs." );
             }
 
Index: src/com/ecyrd/jspwiki/Release.java
===================================================================
--- src/com/ecyrd/jspwiki/Release.java	(revision 942373)
+++ src/com/ecyrd/jspwiki/Release.java	(working copy)
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "12";
+    public static final String     BUILD         = "13";
     
     /**
      *  This is the generic version string you should use
Index: src/com/ecyrd/jspwiki/auth/AuthorizationManager.java
===================================================================
--- src/com/ecyrd/jspwiki/auth/AuthorizationManager.java	(revision 890898)
+++ src/com/ecyrd/jspwiki/auth/AuthorizationManager.java	(working copy)
@@ -412,6 +412,7 @@
             if (policyURL != null) 
             {
                 File policyFile = new File( policyURL.getPath() );
+                log.info("We found security policy URL: " + policyURL + " and transformed it to file " + policyFile.getAbsolutePath());
                 m_localPolicy = new LocalPolicy( policyFile, engine.getContentEncoding() );
                 m_localPolicy.refresh();
                 log.info( "Initialized default security policy: " + policyFile.getAbsolutePath() );
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 942373)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2010-05-09  Harry Metske <metskem@apache.org>
+
+        * 2.8.4-svn-13
+        
+        * JSPWIKI-646 JSPWiki cannot run without unpacking the war file
+        
 2010-05-08  Harry Metske <metskem@apache.org>
 
         * 2.8.4-svn-12
Index: src/com/ecyrd/jspwiki/auth/AuthenticationManager.java
===================================================================
--- src/com/ecyrd/jspwiki/auth/AuthenticationManager.java	(revision 890898)
+++ src/com/ecyrd/jspwiki/auth/AuthenticationManager.java	(working copy)
@@ -20,7 +20,7 @@
  */
 package com.ecyrd.jspwiki.auth;
 
-import java.io.File;
+import java.io.*;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.security.Principal;
@@ -605,7 +605,7 @@
         {
             try
             {
-                return defaultFile.toURL();
+                return defaultFile.toURI().toURL();
             }
             catch ( MalformedURLException e)
             {
@@ -630,15 +630,36 @@
         {
             try
             {
-                path = engine.getServletContext().getResource("/WEB-INF/"+name);
+                //  create a tmp file of the policy loaded as an InputStream and return the URL to it
+                //  
+                InputStream is = engine.getServletContext().getResourceAsStream("/WEB-INF/" + name);
+                File tmpFile = File.createTempFile("temp." + name, "");
+                tmpFile.deleteOnExit();
+
+                OutputStream os = new FileOutputStream(tmpFile);
+
+                byte[] buff = new byte[1024];
+
+                while (is.read(buff) != -1)
+                {
+                    os.write(buff);
+                }
+
+                os.close();
+
+                path = tmpFile.toURI().toURL();
+
             }
             catch( MalformedURLException e )
             {
                 // This should never happen unless I screw up
                 log.fatal("Your code is b0rked.  You are a bad person.");
             }
+            catch (IOException e)
+            {
+               log.error("failed to load security policy from " + name + ",stacktrace follows", e);
+            }
         }
-
         return path;
     }

