Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added how-to for the security policy when using the Java security manager.

...

Once the server is running connect your debugger to port 8000. If "suspend=y" is used, it will will block, waiting for a debug connection before starting the server.

Running Wookie with a security manager

If you are running Wookie with a security manager you will have to grant some permissions to get Wookie running properly. Otherwise you are likely to run into this of a similar error:

No Format
 
SEVERE: Exception sending context initialized event to listener instance of
 class org.apache.wookie.server.ContextListener 
java.security.AccessControlException: access denied
(java.util.PropertyPermission user.dir read) at ...

If you can't turn off the security manager but don't really care about it, you can consider to replace to contents of the policy file (in Tomcat this is typically $TOMCAT_HOME/conf/catalina.policy) with the grant all statement:

No Format
 
grant {
  permission java.security.AllPermission;
};

This is not a recommended way of working for a production environment, because it effectively means turning off security alltogether.

Another option is to properly configure the security policy file. Below is a list of permissions that Wookie needs. Most of these are for Hibernate that needs to generate 'enhanced' classes at runtime.

Code Block

// fixes access denied (java.util.PropertyPermission user.dir read)
grant { 
  permission java.util.PropertyPermission "*", "read,write";
};


// fixes access denied (java.io.FilePermission TOMCAT_HOME\bin\local.widgetserver.properties read)
grant {
  permission java.io.FilePermission 
	"<<ALL FILES>>", "read, write";
};

// fixes access denied (java.net.SocketPermission localhost resolve)
grant  {
   permission java.net.SocketPermission "*", "resolve,connect";
};

// fixes access denied (java.lang.RuntimePermission accessClassInPackage.org.apache.catalina)
// fixes access denied (java.lang.RuntimePermission accessDeclaredMembers)
// fixes access denied (java.lang.RuntimePermission getProtectionDomain)
grant {
    permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina";
	permission java.lang.RuntimePermission "accessDeclaredMembers";
	permission java.lang.RuntimePermission "getProtectionDomain";
};

// fixes access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
grant  {
   permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};

Note that some of these fixes are still not very strict, which means that if you
are really concerned to limit permissions as much as possible, you need to define
stricter rules, but it's a start and should get your Wookie instance up-and-running.

For more information how to do this in Tomcat, see the Security Manager HOW-TO

Running Wookie with other configurations

Other configurations of Wookie can also be run; the main requirements are a servlet container and a database. The setup information for databases can be found in the /scripts directory. How these are loaded into configurations is defined in build.xml; the main requirement is to define connection details in scripts/database/hibernate.cfg.xml and to define the database setup script in scripts/database/widgetdb.sql.

...