If you change the target server for an EJB project and attempt to run the application on a server target that is different from its generated deployment code, the application fails to run. To fix this problem, you need to regenerate the deployment code. Right-click the EJB project, and select Deploy.