Hello,
I try to implement your sample, works fine. Now I extend the sample and get
this error: can help me on this? Calling with
public class SfulJavaClient {
public static void main(String args[]) {
try {
InitialContext ic = new InitialContext();
Sful sful = (Sful)
ic.lookup("com.company.companydb.ejbstuff.Sful");
sful.setId("duke");
System.out.println("Sful id = " + sful.getId());
} catch(Exception e) {
e.printStackTrace();
}
}
}
It works . I want to call from BackingBean called from a JSF Site
The Staticmanagement is like
@SuppressWarnings("unchecked")
@Stateful
public class StaticmanagementBean {
@EJB
private static Sful sful;
.
//That's the EJB call
public static void addErrorMessage(String msg) {
try {
sful.addErrorMessage(msg);
} catch(Exception e) {
e.printStackTrace();
}
}
//EJB add an extra method adjusted .
@Override
public void addErrorMessage(String msg) {
FacesMessage facesMsg = new
FacesMessage(FacesMessage.SEVERITY_ERROR,
msg, msg);
FacesContext fc = FacesContext.getCurrentInstance();
fc.addMessage(null, facesMsg);
}
The error occure, when I start the application and the StaticmanagementBean
does the Konstruktor. I'm not calling the EJB within the Constructor .
can U help on this?
Here's error from the glassfish server . during the deployment .
04.03.2008 16:54:25 com.sun.enterprise.deployment.autodeploy.AutoDeployer
deploy
INFO: [AutoDeploy] Selecting file
F:\E\JavaEnterprise\Diplomarbeit\Programme\glassfish\domains\domain1\autodep
loy\company-db-ejb.ear for autodeployment.
04.03.2008 16:54:25 com.sun.enterprise.deployment.autodeploy.AutoDeployer
undeployJavaEEArchive
INFO: Autoundeploying application :company-db-ejb
04.03.2008 16:54:25
com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo <init>
INFO: Undeployment by user Unknown of module company-db-ejb
(type=Application) starting
04.03.2008 16:54:25 com.sun.enterprise.server.ApplicationManager
applicationUndeployed
INFO: CORE5022: All ejb(s) of [company-db-ejb] were unloaded successfully!
04.03.2008 16:54:26
com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo
reportEnd
INFO: Undeployment by user Unknown of module company-db-ejb
(type=Application) completed successfully, elapsed time 750 ms
04.03.2008 16:54:26 com.sun.enterprise.deployment.autodeploy.AutoDeployer
invokeUndeploymentService
INFO: [AutoDeploy] Successfully autoundeployed :
F:\E\JavaEnterprise\Diplomarbeit\Programme\glassfish\domains\domain1\autodep
loy\company-db-ejb.ear.
04.03.2008 16:54:26
com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo <init>
INFO: Deployment by user Unknown of module company-db-ejb (type=Application)
starting
04.03.2008 16:54:26
oracle.toplink.essentials.session.file:/F:/E/JavaEnterprise/Diplomarbeit/Pro
gramme/glassfish/domains/domain1/applications/j2ee-apps/company-db-ejb/compa
nydb-ejb_jar/-company
INFO: TopLink, version: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs
(12/06/2007))
04.03.2008 16:54:26
oracle.toplink.essentials.session.file:/F:/E/JavaEnterprise/Diplomarbeit/Pro
gramme/glassfish/domains/domain1/applications/j2ee-apps/company-db-ejb/compa
nydb-ejb_jar/-company
INFO: Server: unknown
04.03.2008 16:54:26
oracle.toplink.essentials.session.file:/F:/E/JavaEnterprise/Diplomarbeit/Pro
gramme/glassfish/domains/domain1/applications/j2ee-apps/company-db-ejb/compa
nydb-ejb_jar/-company
INFO:
file:/F:/E/JavaEnterprise/Diplomarbeit/Programme/glassfish/domains/domain1/a
pplications/j2ee-apps/company-db-ejb/companydb-ejb_jar/-company login
successful
04.03.2008 16:54:26
oracle.toplink.essentials.session.file:/F:/E/JavaEnterprise/Diplomarbeit/Pro
gramme/glassfish/domains/domain1/applications/j2ee-apps/company-db-ejb/compa
nydb-ejb_jar/-company
INFO:
file:/F:/E/JavaEnterprise/Diplomarbeit/Programme/glassfish/domains/domain1/a
pplications/j2ee-apps/company-db-ejb/companydb-ejb_jar/-company logout
successful
04.03.2008 16:54:28
com.sun.jdo.spi.persistence.support.ejb.ejbc.BaseProcessor executeDDLs
WARNUNG: JDO76609: Got SQLException executing statement "CREATE TABLE
mySuperTypeId (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL, PRIMARY KEY
(SEQ_NAME))": java.sql.SQLException: Table/View 'MYSUPERTYPEID' already
exists in Schema 'UNTERNEHMEN'.
04.03.2008 16:54:28
com.sun.jdo.spi.persistence.support.ejb.ejbc.BaseProcessor executeDDLs
WARNUNG: JDO76609: Got SQLException executing statement "CREATE TABLE
entityid (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL, PRIMARY KEY
(SEQ_NAME))": java.sql.SQLException: Table/View 'ENTITYID' already exists in
Schema 'UNTERNEHMEN'.
04.03.2008 16:54:28 com.sun.enterprise.deployment.phasing.J2EECPhase
runPhase
INFO: deployed with moduleid = company-db-ejb
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory checking if SFSBVersionPolicy need to be added
04.03.2008 16:54:28 com.sun.ejb.base.sfsb.util.EJBServerConfigLookup
needToAddSFSBVersionInterceptors
INFO: EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==>
false
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory addSFSBVersionPolicy? false
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory checking if SFSBVersionPolicy need to be added
04.03.2008 16:54:28 com.sun.ejb.base.sfsb.util.EJBServerConfigLookup
needToAddSFSBVersionInterceptors
INFO: EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==>
false
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory addSFSBVersionPolicy? false
04.03.2008 16:54:28 com.sun.ejb.containers.BaseContainer initializeHome
INFO: **RemoteBusinessJndiName: ch.company.ejbdemo.SimpleSession;
remoteBusIntf: ch.company.ejbdemo.SimpleSession
04.03.2008 16:54:28
com.sun.enterprise.connectors.system.ActiveJmsResourceAdapter
updateMDBRuntimeInfo
INFO: endpoint.determine.destinationtype
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory checking if SFSBVersionPolicy need to be added
04.03.2008 16:54:28 com.sun.ejb.base.sfsb.util.EJBServerConfigLookup
needToAddSFSBVersionInterceptors
INFO: EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==>
false
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory addSFSBVersionPolicy? false
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory checking if SFSBVersionPolicy need to be added
04.03.2008 16:54:28 com.sun.ejb.base.sfsb.util.EJBServerConfigLookup
needToAddSFSBVersionInterceptors
INFO: EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==>
false
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory addSFSBVersionPolicy? false
04.03.2008 16:54:28 com.sun.ejb.containers.BaseContainer initializeHome
INFO: **RemoteBusinessJndiName: com.company.companydb.ejbstuff.Sful;
remoteBusIntf: com.company.companydb.ejbstuff.Sful
04.03.2008 16:54:28 com.sun.enterprise.naming.NamingManagerImpl bindObjects
INFO: naming.bind
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory checking if SFSBVersionPolicy need to be added
04.03.2008 16:54:28 com.sun.ejb.base.sfsb.util.EJBServerConfigLookup
needToAddSFSBVersionInterceptors
INFO: EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==>
false
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory addSFSBVersionPolicy? false
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory checking if SFSBVersionPolicy need to be added
04.03.2008 16:54:28 com.sun.ejb.base.sfsb.util.EJBServerConfigLookup
needToAddSFSBVersionInterceptors
INFO: EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==>
false
04.03.2008 16:54:28 com.sun.enterprise.iiop.POARemoteReferenceFactory
createReferenceFactory
INFO: POARemoteRefFactory addSFSBVersionPolicy? false
04.03.2008 16:54:28 com.sun.ejb.containers.BaseContainer initializeHome
INFO: **RemoteBusinessJndiName:
com.company.companydb.model.ejbprovider.CompanyDBMgrRemote; remoteBusIntf:
com.company.companydb.model.ejbprovider.CompanyDBMgrRemote
04.03.2008 16:54:28 com.sun.enterprise.server.AbstractLoader loadEjbs
INFO: LDR5010: All ejb(s) of [company-db-ejb] loaded successfully!
04.03.2008 16:54:28
com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo
reportEnd
INFO: Deployment by user Unknown of module company-db-ejb (type=Application)
completed with warning, elapsed time 2891 ms
04.03.2008 16:54:28 com.sun.enterprise.deployment.autodeploy.AutoDeployer
parseResult
WARNUNG: Warning while deploying :
JDO76614: Deployment encountered SQL Exceptions:
JDO76609: Got SQLException executing statement "CREATE TABLE
mySuperTypeId (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL, PRIMARY KEY
(SEQ_NAME))": java.sql.SQLException: Table/View 'MYSUPERTYPEID' already
exists in Schema 'UNTERNEHMEN'.
JDO76609: Got SQLException executing statement "CREATE TABLE entityid
(SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL, PRIMARY KEY (SEQ_NAME))":
java.sql.SQLException: Table/View 'ENTITYID' already exists in Schema
'UNTERNEHMEN'.
.
04.03.2008 16:54:28 com.sun.enterprise.deployment.autodeploy.AutoDeployer
markFileAfterDeployment
INFO: [AutoDeploy] Autodeployed :
F:\E\JavaEnterprise\Diplomarbeit\Programme\glassfish\domains\domain1\autodep
loy\company-db-ejb.ear with at least one warning. Please check the
server.log file and make sure the autodeployment completed as expected.
04.03.2008 16:54:29 com.sun.enterprise.deployment.autodeploy.AutoDeployer
deploy
INFO: [AutoDeploy] Selecting file
F:\E\JavaEnterprise\Diplomarbeit\Programme\glassfish\domains\domain1\autodep
loy\company-db.war for autodeployment.
04.03.2008 16:54:29 com.sun.enterprise.deployment.autodeploy.AutoDeployer
undeployJavaEEArchive
INFO: Autoundeploying application :company-db
04.03.2008 16:54:29
com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo <init>
INFO: Undeployment by user Unknown of module company-db (type=Web Module)
starting
04.03.2008 16:54:29
com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo
reportEnd
INFO: Undeployment by user Unknown of module company-db (type=Web Module)
completed successfully, elapsed time 156 ms
04.03.2008 16:54:29 com.sun.enterprise.deployment.autodeploy.AutoDeployer
invokeUndeploymentService
INFO: [AutoDeploy] Successfully autoundeployed :
F:\E\JavaEnterprise\Diplomarbeit\Programme\glassfish\domains\domain1\autodep
loy\company-db.war.
04.03.2008 16:54:29
com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo <init>
INFO: Deployment by user Unknown of module company-db (type=Web Module)
starting
04.03.2008 16:54:29
com.sun.enterprise.deployment.annotation.impl.DefaultErrorHandler error
SCHWERWIEGEND: Class [ Lcom/company/companydb/ejbstuff/Sful; ] not found.
Error while loading [ class com.company.companydb.bb.StaticmanagementBean ]
04.03.2008 16:54:29 com.sun.enterprise.deployment.archivist.Archivist
readAnnotations
WARNUNG: Error in annotation processing: java.lang.NoClassDefFoundError:
Lcom/company/companydb/ejbstuff/Sful;
04.03.2008 16:54:29 com.sun.enterprise.deployment.phasing.J2EECPhase
runPhase
INFO: deployed with moduleid = company-db
04.03.2008 16:54:29 com.sun.faces.config.ConfigureListener
contextInitialized
INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03)
for context '/company-db'
04.03.2008 16:54:29 org.apache.catalina.core.ApplicationContext log
SCHWERWIEGEND: WebModule[/company-db]PWC1275: Exception sending context
initialized event to listener instance of class
com.sun.faces.config.ConfigureListener
java.lang.NoClassDefFoundError: Lcom/company/companydb/ejbstuff/Sful;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
at
com.sun.faces.config.ManagedBeanFactoryImpl.scanForAnnotations(ManagedBeanFa
ctoryImpl.java:1133)
at
com.sun.faces.config.ManagedBeanFactoryImpl.<init>(ManagedBeanFactoryImpl.ja
va:156)
at
com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:899)
at
com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:491)
at
com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.
java:381)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
4523)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:5184)
at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:9
73)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:957)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1584)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
at
com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebMod
uleDeployEventListener.java:182)
at
com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebMod
uleDeployEventListener.java:278)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEvent
Listener(AdminEventMulticaster.java:974)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent
(AdminEventMulticaster.java:961)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEvent
Multicaster.java:464)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEve
ntMulticaster.java:176)
at
com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastE
vent(DeploymentNotificationHelper.java:308)
at
com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(
DeploymentServiceUtils.java:226)
at
com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(
ServerDeploymentTarget.java:298)
at
com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(Applica
tionStartPhase.java:132)
at
com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(Deploymen
tPhase.java:108)
at
com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDe
ploymentService.java:919)
at
com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymen
tService.java:276)
at
com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymen
tService.java:294)
at
com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(ApplicationsC
onfigMBean.java:555)
at sun.reflect.GeneratedMethodAccessor1519.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanSer
verInterceptor.java:836)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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(SunoneInte
rceptor.java:304)
at
com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.
java:174)
at
com.sun.enterprise.deployment.autodeploy.AutoDeployer.invokeDeploymentServic
e(AutoDeployer.java:564)
at
com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployJavaEEArchive(Au
toDeployer.java:545)
at
com.sun.enterprise.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.ja
va:492)
at
com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer
.java:267)
at
com.sun.enterprise.deployment.autodeploy.AutoDeployControllerImpl$AutoDeploy
Task.run(AutoDeployControllerImpl.java:374)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
04.03.2008 16:54:29 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: PWC1306: Startup of context /company-db failed due to
previous errors
04.03.2008 16:54:29
com.sun.enterprise.deployment.phasing.PEDeploymentService$AuditInfo
reportEnd
INFO: Deployment by user Unknown of module company-db (type=Web Module)
completed successfully, elapsed time 531 ms
04.03.2008 16:54:29 com.sun.enterprise.deployment.autodeploy.AutoDeployer
markFileAfterDeployment
INFO: [AutoDeploy] Successfully autodeployed :
F:\E\JavaEnterprise\Diplomarbeit\Programme\glassfish\domains\domain1\autodep
loy\company-db.war.