3 Replies Latest reply on Apr 25, 2003 4:30 PM by Deepak Hathwar

    Calling local references to EJB's from MBean

    Deepak Hathwar Newbie

      Hi:

      I am using JBoss3.0.6. I created an MBean which depends on some EJBs for our product. When I start JBoss, the EJB's are deployed and then the MBean is started. This works great. However, once the MBean starts, I get a ClassCastException. I am trying to access all EJBs as local references from the Mbean. I am not sure why, I get a class cast exception. Here's the trace:

      2003-04-21 13:36:35,207 INFO [org.jboss.deployment.EARDeployer] Init J2EE application: file:/E:/jboss-3.0.6/server/FuelPath/deploy/FuelPath.ear
      2003-04-21 13:36:37,740 INFO [com.kyrus.fuelpath.main.FuelPathService] Creating
      2003-04-21 13:36:37,740 INFO [com.kyrus.fuelpath.main.FuelPathService] Created
      2003-04-21 13:36:40,224 INFO [org.jboss.ejb.EjbModule] Creating
      2003-04-21 13:36:40,284 INFO [org.jboss.ejb.EjbModule] Deploying BusinessRuleBean
      2003-04-21 13:36:40,534 INFO [org.jboss.ejb.EjbModule] Deploying DeliveryBean
      2003-04-21 13:36:40,554 INFO [org.jboss.ejb.EjbModule] Deploying MeterReadingBean
      2003-04-21 13:36:40,584 INFO [org.jboss.ejb.EjbModule] Deploying DisplayMessageBean
      2003-04-21 13:36:40,615 INFO [org.jboss.ejb.EjbModule] Deploying GPCVersionBean
      2003-04-21 13:36:40,655 INFO [org.jboss.ejb.EjbModule] Deploying VirtualDevicePublishedBean
      2003-04-21 13:36:40,695 INFO [org.jboss.ejb.EjbModule] Deploying StoreInfoBean
      2003-04-21 13:36:40,725 INFO [org.jboss.ejb.EjbModule] Deploying CardPaymentBean
      2003-04-21 13:36:40,745 INFO [org.jboss.ejb.EjbModule] Deploying CarWashBean
      2003-04-21 13:36:40,765 INFO [org.jboss.ejb.EjbModule] Deploying LogBean
      2003-04-21 13:36:40,805 INFO [org.jboss.ejb.EjbModule] Deploying TenderValidationBean
      2003-04-21 13:36:40,825 INFO [org.jboss.ejb.EjbModule] Deploying HoseBean
      2003-04-21 13:36:40,855 INFO [org.jboss.ejb.EjbModule] Deploying AdvertisingBean
      2003-04-21 13:36:40,875 INFO [org.jboss.ejb.EjbModule] Deploying TenderBean
      2003-04-21 13:36:40,895 INFO [org.jboss.ejb.EjbModule] Deploying DispenserBean
      2003-04-21 13:36:40,925 INFO [org.jboss.ejb.EjbModule] Deploying BusinessActionBean
      2003-04-21 13:36:40,955 INFO [org.jboss.ejb.EjbModule] Deploying VirtualDeviceSubscribedBean
      2003-04-21 13:36:40,985 INFO [org.jboss.ejb.EjbModule] Deploying BusinessMessageBean
      2003-04-21 13:36:41,015 INFO [org.jboss.ejb.EjbModule] Deploying VirtualDeviceBean
      2003-04-21 13:36:41,035 INFO [org.jboss.ejb.EjbModule] Deploying FuelDiscountsBean
      2003-04-21 13:36:41,065 INFO [org.jboss.ejb.EjbModule] Deploying ContactBean
      2003-04-21 13:36:41,095 INFO [org.jboss.ejb.EjbModule] Deploying BusinessRuleLogBean
      2003-04-21 13:36:41,135 INFO [org.jboss.ejb.EjbModule] Deploying InventoryBean
      2003-04-21 13:36:41,165 INFO [org.jboss.ejb.EjbModule] Deploying ExceptionsBean
      2003-04-21 13:36:41,185 INFO [org.jboss.ejb.EjbModule] Deploying PrinterInformationBean
      2003-04-21 13:36:41,235 INFO [org.jboss.ejb.EjbModule] Deploying GlobalStoreConfigurationBean
      2003-04-21 13:36:41,265 INFO [org.jboss.ejb.EjbModule] Deploying DiscountReportingBean
      2003-04-21 13:36:41,296 INFO [org.jboss.ejb.EjbModule] Deploying SerialPortBean
      2003-04-21 13:36:41,326 INFO [org.jboss.ejb.EjbModule] Deploying GradeLookupBean
      2003-04-21 13:36:41,346 INFO [org.jboss.ejb.EjbModule] Deploying BlendsBean
      2003-04-21 13:36:41,366 INFO [org.jboss.ejb.EjbModule] Deploying DevicesBean
      2003-04-21 13:36:41,396 INFO [org.jboss.ejb.EjbModule] Deploying SaleBean
      2003-04-21 13:36:41,426 INFO [org.jboss.ejb.EjbModule] Deploying ReceiptTextBean
      2003-04-21 13:36:41,456 INFO [org.jboss.ejb.EjbModule] Deploying TankBean
      2003-04-21 13:36:41,486 INFO [org.jboss.ejb.EjbModule] Deploying ManualAuthorizationBean
      2003-04-21 13:36:41,516 INFO [org.jboss.ejb.EjbModule] Deploying FleetCardBean
      2003-04-21 13:36:41,536 INFO [org.jboss.ejb.EjbModule] Deploying SystemTableBean
      2003-04-21 13:36:41,566 INFO [org.jboss.ejb.EjbModule] Deploying PriceHistoryBean
      2003-04-21 13:36:41,586 INFO [org.jboss.ejb.EjbModule] Deploying MessageRouterBean
      2003-04-21 13:36:41,626 INFO [org.jboss.ejb.EjbModule] Deploying CashPaymentBean
      2003-04-21 13:36:41,656 INFO [org.jboss.ejb.EjbModule] Deploying StateBean
      2003-04-21 13:36:41,686 INFO [org.jboss.ejb.EjbModule] Deploying FleetRequirementBean
      2003-04-21 13:36:41,706 INFO [org.jboss.ejb.EjbModule] Deploying TopicsBean
      2003-04-21 13:36:41,726 INFO [org.jboss.ejb.EjbModule] Deploying DatabaseCollectionBean
      2003-04-21 13:36:41,756 INFO [org.jboss.ejb.EjbModule] Deploying JdbcAdapterBean
      2003-04-21 13:36:43,829 INFO [org.jboss.ejb.EjbModule] Created
      2003-04-21 13:36:43,829 INFO [com.kyrus.fuelpath.main.FuelPathService] Starting
      2003-04-21 13:36:43,839 INFO [com.kyrus.fuelpath.main.FuelPathService] FuelPath Application has been started as an MBean by JBOSS!!!
      2003-04-21 13:36:43,849 INFO [com.kyrus.fuelpath.main.FuelPathService] FuelPath Application: Still running
      2003-04-21 13:36:43,879 INFO [STDOUT] OS Environment: Windows 2000
      2003-04-21 13:36:43,879 INFO [com.kyrus.fuelpath.main.FuelPathService] Started
      2003-04-21 13:36:43,889 INFO [org.jboss.ejb.EjbModule] Starting
      2003-04-21 13:36:44,480 INFO [STDOUT] Properties file path = file:/E:/jboss-3.0.6/server/FuelPath/lib/FuelPath/FuelPathServer.jar!/FuelPath.properties
      2003-04-21 13:36:45,752 INFO [STDOUT] 1050946605752:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:45,752 INFO [STDOUT] EJB_HOST = localhost
      2003-04-21 13:36:45,942 INFO [STDOUT] 1050946605942:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:45,942 INFO [STDOUT] Class name = $Proxy123
      2003-04-21 13:36:45,942 INFO [STDOUT] 1050946605942:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:45,952 INFO [STDOUT] java.lang.ClassCastException: $Proxy123
      2003-04-21 13:36:45,952 INFO [STDOUT] 1050946605952:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:45,962 INFO [STDOUT] at com.kyrus.fuelpath.persistence.databasecollection.SiteInfo.getDatabaseCollectionHome(SiteInfo.java:303)
      2003-04-21 13:36:45,972 INFO [STDOUT] 1050946605972:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:45,972 INFO [STDOUT] at com.kyrus.fuelpath.persistence.databasecollection.SiteInfo.getAllAdvertisingData(SiteInfo.java:620)
      2003-04-21 13:36:45,992 INFO [STDOUT] 1050946605992:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,092 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathServerConfigurationData.loadConfiguration(FuelPathServerConfigurationData.java:2053)
      2003-04-21 13:36:46,092 INFO [STDOUT] 1050946606092:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,102 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathServerConfigurationData.(FuelPathServerConfigurationData.java:502)
      2003-04-21 13:36:46,112 INFO [STDOUT] 1050946606112:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,122 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathServerConfigurationData.makeInstance(FuelPathServerConfigurationData.java:2614)
      2003-04-21 13:36:46,132 INFO [STDOUT] 1050946606132:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,132 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathService.loadConfiguration(FuelPathService.java:235)
      2003-04-21 13:36:46,142 INFO [STDOUT] 1050946606142:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,152 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathService.init(FuelPathService.java:192)
      2003-04-21 13:36:46,163 INFO [STDOUT] 1050946606163:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,163 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathService.run(FuelPathService.java:161)
      2003-04-21 13:36:46,213 INFO [STDOUT] 1050946606173:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,213 INFO [STDOUT] at java.lang.Thread.run(Thread.java:536)
      2003-04-21 13:36:46,223 INFO [STDOUT] 1050946606223:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,223 INFO [STDOUT] Logged a message:
      ================================================================================
      com.kyrus.fuelpath.persistence.PersistenceException:
      Error Message = $Proxy123
      java.lang.ClassCastException:
      Error Message = $Proxy123

      Max Severity Level = Warning: Continue Processing

      Stack Trace of Passed Exception:
      java.lang.ClassCastException: $Proxy123
      at com.kyrus.fuelpath.persistence.databasecollection.SiteInfo.getDatabaseCollectionHome(SiteInfo.java:303)
      at com.kyrus.fuelpath.persistence.databasecollection.SiteInfo.getAllAdvertisingData(SiteInfo.java:620)
      at com.kyrus.fuelpath.main.FuelPathServerConfigurationData.loadConfiguration(FuelPathServerConfigurationData.java:2053)
      at com.kyrus.fuelpath.main.FuelPathServerConfigurationData.(FuelPathServerConfigurationData.java:502)
      at com.kyrus.fuelpath.main.FuelPathServerConfigurationData.makeInstance(FuelPathServerConfigurationData.java:2614)
      at com.kyrus.fuelpath.main.FuelPathService.loadConfiguration(FuelPathService.java:235)
      at com.kyrus.fuelpath.main.FuelPathService.init(FuelPathService.java:192)
      at com.kyrus.fuelpath.main.FuelPathService.run(FuelPathService.java:161)
      at java.lang.Thread.run(Thread.java:536)

      ================================================================================
      2003-04-21 13:36:46,383 INFO [STDOUT] 1050946606383:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,393 INFO [STDOUT] at com.kyrus.fuelpath.persistence.databasecollection.SiteInfo.getAllAdvertisingData(SiteInfo.java:633)
      2003-04-21 13:36:46,413 INFO [STDOUT] 1050946606413:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,413 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathServerConfigurationData.loadConfiguration(FuelPathServerConfigurationData.java:2053)
      2003-04-21 13:36:46,423 INFO [STDOUT] 1050946606423:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,493 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathServerConfigurationData.(FuelPathServerConfigurationData.java:502)
      2003-04-21 13:36:46,493 INFO [STDOUT] 1050946606493:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,503 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathServerConfigurationData.makeInstance(FuelPathServerConfigurationData.java:2614)
      2003-04-21 13:36:46,513 INFO [STDOUT] 1050946606513:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,513 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathService.loadConfiguration(FuelPathService.java:235)
      2003-04-21 13:36:46,533 INFO [STDOUT] 1050946606523:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,533 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathService.init(FuelPathService.java:192)
      2003-04-21 13:36:46,543 INFO [STDOUT] 1050946606543:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,553 INFO [STDOUT] at com.kyrus.fuelpath.main.FuelPathService.run(FuelPathService.java:161)
      2003-04-21 13:36:46,563 INFO [STDOUT] 1050946606563:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,563 INFO [STDOUT] at java.lang.Thread.run(Thread.java:536)
      2003-04-21 13:36:46,583 INFO [STDOUT] 1050946606583:Thread[Thread-22,5,jboss]:
      2003-04-21 13:36:46,583 INFO [STDOUT] Unable to load configuration. Server is terminating.
      2003-04-21 13:36:46,703 INFO [org.jboss.system.server.Server] Undeploying all packages
      2003-04-21 13:36:46,703 INFO [org.jboss.deployment.MainDeployer] Undeploying file:/E:/jboss-3.0.6/server/FuelPath/deploy/FuelPath.ear
      2003-04-21 13:36:46,713 INFO [com.kyrus.fuelpath.main.FuelPathService] Stopping

      I have a sar file that contains a jboss-service.xml in META-INF directory. This service depends on Naming. Also, I have an ear file that contains a jboss-app.xml which defines the MBean service. The ear file also contains, the sar file and the ejbs in a jar file. When I deploy the ear file, the EJBs get deployed first and the MBean service gets started. However, I am having problems getting local references to the EJBS. Looks like, Jboss is still returning a remote reference.

      Is there any configuration changes that I need to make?

      Thanks for all the help.

      Deepak