Commits

Anonymous committed e94da7a

Fixed ejbql errors and spec naughtiness
Fixed jboss-web to ref correct ejbs
Now deploys correctly on jboss!

  • Participants
  • Parent commits 22bc19c

Comments (0)

Files changed (3)

File example/manager/WEB-INF/jboss-web.xml

 <jboss-web>
-    <security-domain>java:/jaas/osuser</security-domain>
+  <security-domain>java:/jaas/osuser</security-domain>
 
-    <ejb-ref>
-        <ejb-ref-name>ejb/osuser/User</ejb-ref-name>
-        <jndi-name>osuser/User</jndi-name>
-    </ejb-ref>
-    <ejb-ref>
-        <ejb-ref-name>ejb/osuser/Group</ejb-ref-name>
-        <jndi-name>osuser/Group</jndi-name>
-    </ejb-ref>
-    <ejb-ref>
-        <ejb-ref-name>ejb/osuser/Membership</ejb-ref-name>
-        <jndi-name>osuser/Membership</jndi-name>
-    </ejb-ref>
+  <ejb-ref>
+    <ejb-ref-name>ejb/osuser/Manager</ejb-ref-name>
+    <jndi-name>ejb/osuser/Manager</jndi-name>
+  </ejb-ref>
 </jboss-web>

File src/java/com/opensymphony/user/provider/ejb/entity/GroupEJB.java

 
 import com.opensymphony.module.propertyset.PropertySet;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import java.rmi.RemoteException;
 
 import java.util.*;
  *
  * @ejb.finder
  *  signature="Collection findAll()"
- *  query="select DISTINCT OBJECT(u) from OSGroup g"
+ *  query="select DISTINCT OBJECT(g) from OSGroup g"
  *  orion-sql-query="1=1 order by $name"
  *  result-type-mapping="Local"
  *
  * @ejb.finder
  *  signature="com.opensymphony.user.provider.ejb.entity.GroupLocal findByName(java.lang.String name)"
- *  query="select DISTINCT OBJECT(u) from OSGroup g where g.name = ?1"
+ *  query="select DISTINCT OBJECT(g) from OSGroup g where g.name = ?1"
  *  orion-sql-query="$name = $1 order by $name"
  *  result-type-mapping="Local"
  *
  * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
  * @author <a href="mailto:mike@atlassian.com">Mike Cannon-Brookes</a>
  * @author <a href="mailto:plightbo@cisco.com">Patrick Lightbody</a>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
  */
 public abstract class GroupEJB extends AbstractEntityAdapter implements EntityBean {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    private static final Log log = LogFactory.getLog(GroupEJB.class);
+
     //~ Methods ////////////////////////////////////////////////////////////////
 
     /**
     *
     * @ejb.interface-method
     */
-    public PropertySet getPropertySet() throws RemoteException {
-        return locatePropertySet(getId().longValue());
+    public PropertySet getPropertySet() {
+        try {
+            return locatePropertySet(getId().longValue());
+        } catch (RemoteException e) {
+            log.error("Unable to look up propertyset", e);
+        }
+
+        return null;
     }
 
     /**
      *  cascade-delete="no"
      *
      * @jboss.relation
-     *  related-pk-field="name"
-     *  fk-column="value"
+     *  related-pk-field="id"
+     *  fk-column="groupid"
      *
      * @jboss.relation-table table-name="osgroup_users"
      *
      * @jboss.relation-mapping style="relation-table"
      *
      * @weblogic.column-map
-     *  key-column="name"
-     *  foreign-key-column="value"
+     *  key-column="id"
+     *  foreign-key-column="groupid"
      *
      * @weblogic.relation
      *  join-table-name="osgroup_users"

File src/java/com/opensymphony/user/provider/ejb/entity/UserEJB.java

 import com.opensymphony.user.provider.ejb.util.Base64;
 import com.opensymphony.user.provider.ejb.util.PasswordDigester;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import java.rmi.RemoteException;
 
 import java.util.*;
  * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
  * @author <a href="mailto:mike@atlassian.com">Mike Cannon-Brookes</a>
  * @author <a href="mailto:plightbo@cisco.com">Patrick Lightbody</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
  */
 public abstract class UserEJB extends ExceptionlessEntityAdapter implements EntityBean {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    private static final Log log = LogFactory.getLog(UserEJB.class);
+
     //~ Methods ////////////////////////////////////////////////////////////////
 
     /**
      *
      * @jboss.relation
      *    related-pk-field="id"
-     *    fk-column="id"
+     *    fk-column="userid"
      *
      * @jboss.relation-mapping style="relation-table"
      *
      *
      * @weblogic.column-map
      * key-column="id"
-     * foreign-key-column="id"
+     * foreign-key-column="userid"
      *
      * @weblogic.relation
      *     join-table-name="osgroup_users"
     *
     * @ejb.interface-method
     */
-    public PropertySet getPropertySet() throws RemoteException {
-        return locatePropertySet(getId().longValue());
+    public PropertySet getPropertySet() {
+        try {
+            return locatePropertySet(getId().longValue());
+        } catch (RemoteException e) {
+            log.error("Unable to look up propertyset", e);
+        }
+
+        return null;
     }
 
     /**