Tuesday, 21 April 2009
6-Writing JAVA Clients for Calling BEA WebLogic EJBs
VI- How to check the health of deployment-listing EJBs
I used a very usefull tool to find out whether my EJB is deployed. It looked OK. The problem was I did not know how the output should look. For that purpose I included below the output for a correctly created and deployed EJB.
Find WebLogic MBeans with Ease
http://monduke.com/2007/01/14/find-weblogic-mbeans-with-ease/
“By the way, if you’ve never used weblogic.Admin before, you must first run the setEnv (or setDomainEnv) script in your domain directory to set up environment variables and paths.
Now, that output is all well and good but it might not make finding things any easier. Time for a little redirection, my friend:
java weblogic.Admin -username weblogic -password weblogic -url t3://localhost:7101 query -pretty -pattern *:* > MBeans.txt”
MBeanName: "DefaultDomain:Name=java2s,Location=DefaultServer,Type=ApplicationConfig"
AltDescriptorPath:
AltWLSDescriptorPath:
CachingDisabled: false
Components: java2s
ConnectorComponents:
DeploymentTimeout: 3600000
DeploymentType: COMPONENT
EJBComponents: java2s
FullPath: C:\EJBstateless\deploy\java2s.jar
InternalApp: false
LoadOrder: 100
Name: java2s
Notes:
ObjectName: java2s
Parent: DefaultDomain
Path: C:\EJBstateless\deploy\java2s.jar
Registered: true
StagedTargets:
StagingMode: stage
StagingPath:
TwoPhase: true
Type: Application
WebServiceComponents:
-----------------------------------------------------
MBeanName: "DefaultDomain:ServerRuntime=DefaultServer,Name=java2s,ApplicationRuntime=java2s,Location=DefaultServer,Type=EJBComponentRuntime"
CachingDisabled: true
DeploymentState: 2
EJBComponent: java2s
EJBRuntimes: CalcARSBean
KodoPersistenceUnitRuntimes:
ModuleId: java2s.jar
Name: java2s
Parent: java2s
Registered: true
Type: EJBComponentRuntime
---------------------------
MBeanName: "DefaultDomain:ServerRuntime=DefaultServer,Name=java2s,Location=DefaultServer,Type=ApplicationRuntime"
ApplicationName: java2s
ApplicationVersion:
CachingDisabled: true
ComponentRuntimes: java2s
HealthState: Component:null,State:HEALTH_OK,MBean:null,ReasonCode:[]
KodoPersistenceUnitRuntimes:
LibraryRuntimes:
Name: java2s
OptionalPackageRuntimes:
Parent: DefaultServer
QueryCacheRuntimes:
Registered: true
Type: ApplicationRuntime
WseeRuntimes:
------------------------------------------------------------
MBeanName: "DefaultDomain:Name=java2s,Location=DefaultServer,Type=EJBComponentConfig,ApplicationConfig=java2s"
ActivatedTargets:
Application: java2s
CachingDisabled: false
DeploymentOrder: 1000
EJBComponentRuntime:
ExtraEjbcOptions:
ExtraRmicOptions:
ForceGeneration: false
JavaCompiler:
JavaCompilerPostClassPath:
JavaCompilerPreClassPath:
KeepGenerated: true
Name: java2s
Notes:
ObjectName: java2s
Parent: java2s
Registered: true
Targets: DefaultServer
TmpPath: tmp_ejb
Type: EJBComponent
URI: java2s.jar
VerboseEJBDeploymentEnabled: false
-----------------------------------------------------------------
MBeanName: "DefaultDomain:ServerRuntime=DefaultServer,Name=CalcARSBean,ApplicationRuntime=java2s,Location=DefaultServer,Type=EJBTransactionRuntime,EJBComponentRuntime=java2s,StatelessEJBRuntime=CalcARSBean"
CachingDisabled: true
Name: CalcARSBean
Parent: CalcARSBean
Registered: true
TransactionsCommittedTotalCount: 0
TransactionsRolledBackTotalCount: 0
TransactionsTimedOutTotalCount: 0
Type: EJBTransactionRuntime
------------------------------------------
MBeanName: "DefaultDomain:ServerRuntime=DefaultServer,Name=CalcARSBean,ApplicationRuntime=java2s,Location=DefaultServer,Type=EJBPoolRuntime,EJBComponentRuntime=java2s,StatelessEJBRuntime=CalcARSBean"
AccessTotalCount: 0
BeansInUseCount: 0
BeansInUseCurrentCount: 0
CachingDisabled: true
DestroyedTotalCount: 0
IdleBeansCount: 0
MissTotalCount: 0
Name: CalcARSBean
Parent: CalcARSBean
PooledBeansCurrentCount: 0
Registered: true
TimeoutTotalCount: 0
Type: EJBPoolRuntime
WaiterCurrentCount: 0
WaiterTotalCount: 0
My problem was still the below error message after I ran the JAVA client which called deployed EJB functions:
[java] javax.naming.NameNotFoundException: While trying to lookup 'ejb.Coun
tBean.remote' didn't find subcontext 'CountBean'. Resolved 'ejb' [Root exception
is javax.naming.NameNotFoundException: While trying to lookup 'ejb.CountBean.re
mote' didn't find subcontext 'CountBean'. Resolved 'ejb']; remaining name 'Count
Bean/remote'
( prev ) ( next )