2005-09-30

Port in use

Använd TCPView för att hitta vilket program som har snott rmiregistry porten.

2005-09-29

Expiring Stateful SessionBeans from servlet container

When a users session expires in the Servlet container (Tomcat) we want to remove the session's handles to stateful session beans in the EJB container (Jboss). To achieve this we have implemented a HttpSessionListener which does the following:

public void sessionDestroyed(HttpSessionEvent ev) {

HttpSession session = ev.getSession();

Handle ejbHandle = (Handle) session.getAttribute("ejbHandle");

EjbHome ejbHome = (EjbHome) lookupHome

("EjbHome",EjbHome.class);

ejbHome.remove(ejbHandle); // It fails here

}

When the session expires we get the following error in the server.log:
2005-09-28 15:12:03,386 ERROR [org.jboss.ejb.plugins.SecurityInterceptor] Authentication exception, principal=null
. It seems like we don't have permission to call the remove method in the bean. We have configured security for all beans in the ejb-jar.xml using the statements.
We suspect that the sessionDestroyed method is called from a thread
which is not associated with a user, i.e. not authorized to run any
methods in the EJB-layer.
Any suggestions for how to implement expiration of Stateful session
beans from the web-layer?

2005-09-20

Wired 11.12: Bill Joy quote on democracy

Wired 11.12: 'Hope Is a Lousy Defense.': "Democracy is about individuals giving up the ability to do whatever they want so that everybody can have some rights."

2005-09-08

IllegalArgumentException i PropertyUtils

Om du får detta felmeddelande när du kör struts:



java.lang.IllegalArgumentException: No bean specified
at org.apache.commons.beanutils.PropertyUtils.
getPropertyDescriptor(PropertyUtils.java:837)
at org.apache.commons.beanutils.BeanUtils.
setProperty(BeanUtils.java:934)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493)
at org.apache.struts.action.RequestProcessor.
processPopulate(RequestProcessor.java:805)


Så är det säkert så att du har glömt göra "new" på en "nested property". T.ex. om du har en Button() som skall ha en x och en y property.

2005-09-01

Buildproblem



class A {
  A(B b) {
  }
}
class B extends C {}
class C {}
class D {
  m() {
    A a = new A(B);
  }
}


Ändra A till


class A {
  A(C c) { }
}


D kompilerades inte om och det blev runtimefel i class D.