users@glassfish.java.net

EJB Cannot Be Found

From: <glassfish_at_javadesktop.org>
Date: Wed, 20 Jun 2007 08:37:35 PDT

Stacktrace, Managed Bean, and EJB code all posted.

Jun 20, 2007 10:56:07 AM com.sun.enterprise.deployment.autodeploy.AutoDeployer deploy
INFO: [AutoDeploy] Selecting file C:\java\glassfish\domains\domain1\autodeploy\CI.ear for autodeployment.
Jun 20, 2007 10:56:07 AM com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo <init>
INFO: Deployment by user Unknown of module CI (type=Application) starting
Jun 20, 2007 10:56:08 AM com.sun.enterprise.deployment.util.EjbBundleValidator accept
SEVERE: Cannot resolve reference Unresolved Ejb-Ref com.stryker.cmf.newuser.JSFUser/newuser_at_jndi: @null_at_com.stryker.cmf.users.UserAccount_at_Session@null
Jun 20, 2007 10:56:08 AM com.sun.enterprise.deployment.phasing.J2EECPhase runPhase
SEVERE: Exception occured in J2EEC Phasejava.lang.RuntimeException: Cannot resolve reference Unresolved Ejb-Ref com.stryker.cmf.newuser.JSFUser/newuser_at_jndi: @null_at_com.stryker.cmf.users.UserAccount_at_Session@null
com.sun.enterprise.deployment.backend.IASDeploymentException: Error loading deployment descriptors for module [CI] -- Cannot resolve reference Unresolved Ejb-Ref com.stryker.cmf.newuser.JSFUser/newuser_at_jndi: @null_at_com.stryker.cmf.users.UserAccount_at_Session@null
        at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:388)
        at com.sun.enterprise.deployment.backend.AppDeployerBase.loadDescriptors(AppDeployerBase.java:358)
        at com.sun.enterprise.deployment.backend.AppDeployer.explodeArchive(AppDeployer.java:293)
        at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:207)
        at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:148)
        at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:191)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:905)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:276)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:294)
        at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(ApplicationsConfigMBean.java:555)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
        at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
        at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
        at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
        at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
        at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
        at $Proxy1.invoke(Unknown Source)
        at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
        at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
        at com.sun.enterprise.deployment.autodeploy.AutoDeployer.invokeDeploymentService(AutoDeployer.java:564)
        at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployJavaEEArchive(AutoDeployer.java:545)
        at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:492)
        at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:267)
        at com.sun.enterprise.deployment.autodeploy.AutoDeployControllerImpl$AutoDeployTask.run(AutoDeployControllerImpl.java:374)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.RuntimeException: Cannot resolve reference Unresolved Ejb-Ref com.stryker.cmf.newuser.JSFUser/newuser_at_jndi: @null_at_com.stryker.cmf.users.UserAccount_at_Session@null
        at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:430)
        at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1406)
        at com.sun.enterprise.deployment.Application.visit(Application.java:1767)
        at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:470)
        at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:364)
        ... 35 more
Jun 20, 2007 10:56:08 AM com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo reportEnd
INFO: Deployment by user Unknown of module CI (type=Application) failed, elapsed time 1531 ms
Jun 20, 2007 10:56:08 AM com.sun.enterprise.deployment.autodeploy.AutoDeployer parseResult
SEVERE: "DPL8011: autodeployment failure while deploying the application : Error loading deployment descriptors for module [CI] -- Cannot resolve reference Unresolved Ejb-Ref com.stryker.cmf.newuser.JSFUser/newuser_at_jndi: @null_at_com.stryker.cmf.users.UserAccount_at_Session@null
"
Jun 20, 2007 10:56:08 AM com.sun.enterprise.deployment.autodeploy.AutoDeployer markFileAfterDeployment
INFO: [AutoDeploy] Autodeploy failed : C:\java\glassfish\domains\domain1\autodeploy\CI.ear.


---Begin EJB---
package com.stryker.cmf.users;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import javax.ejb.Local;
import javax.ejb.Stateless;
/**
 *
 * @author tony.mattas
 *
 */
@Local @Stateless
public class UserAccount {
        Users iusername;
        UsersFacade userfacade;
        Groups igroupname;
        GroupsFacade groupsfacade;
/**
 * Constructor to load an exisiting user.
 * @param username
 */
        public void adduser(String username, String password) {
                //TODO - Exception user exists
                iusername.setUsername(username);
                iusername.setPassword(hash(password));
                userfacade.save(iusername);
        }
        /**
         * Generates a MD5 Hash
         * @param password Plain text password
         * @return Hashed Password
         */
        private String hash(String password) {
                String hashed = null;
                BigInteger hash;
                try {
                        MessageDigest md5 = MessageDigest.getInstance("MD5");
                        md5.update(password.getBytes());
                        hash = new BigInteger(1, md5.digest());
                        hashed = hash.toString(16);
                } catch (NoSuchAlgorithmException e) {
                        e.printStackTrace();
                }
                return hashed;
        }
/**
 * Adds a group to the current user.
 * @param group
 */
        public void addgroup(String group) {
                Groups newGroup = new Groups(null ,iusername, group);
                groupsfacade.save(newGroup);
        }
}



---Begin Managed Bean---
package com.stryker.cmf.newuser;

import javax.ejb.EJB;

import com.stryker.cmf.users.UserAccount;

public class JSFUser {
        String username = null;
        String password = null;
        @EJB
        public static UserAccount newuser;
        public String add() {
                newuser.adduser(username, password);
                return "success";
        }
        public String getPassword() {
                return password;
        }
        public void setPassword(String password) {
                this.password = password;
        }
        public String getUsername() {
                return username;
        }
        public void setUsername(String username) {
                this.username = username;
        }
}
[Message sent by forum member 'amattas' (amattas)]

http://forums.java.net/jive/thread.jspa?messageID=223094