7 Replies Latest reply on Apr 23, 2007 6:54 AM by zoetsekas

    JBoss Seam and Web Services using OC4J stack

    manuel.guerrero

      Hi,

      as a requirement of our project, we have to expose some services (POJO classes or EJB's) as web services, using OC4J as application server. We are using JBoss Seam as dependency injection engine.

      My first approach was to use OC4J stack and JSR181 annotations. I got a EJB exposed, but when invoking the web service I found that the resources were not injected.

      Then I tried to use the Seam Servlet Filter, but I am affraid the invocation is not done through a servlet.

      Are there any plans to provide a mechanism for injecting resources to an object invoked using SOAP?

      Any experiences in this field that could help?

      Thanks in advance.
      Manuel Guerrero
      Hewlett-Packard

        • 1. Re: JBoss Seam and Web Services using OC4J stack
          gavin.king

          Usually, SOAP invocations occur in the context of some servlet, in which case Seam bijection should work fine as long as you add our servlet filter.

          Are you sure that this is not the case in OC4J?

          • 2. Re: JBoss Seam and Web Services using OC4J stack
            manuel.guerrero

            Well, I didn't get to find that invokation as a servlet invokation, so I changed to axis2 yesterday, which seems to work as I expect. It is a servlet that I can intercept using Seam Servlet Filter and the resources are injected properly.

            The problem with OC4J is that, even if I forced the URL path to a known one, Seam filter didn't intercepted the invokation, that's why I say it doesn't seem to be a servlet invokation.

            Thanks a lot!

            • 3. Re: JBoss Seam and Web Services using OC4J stack
              xiaocase

              Hi, manuel.guerrero@hp.com:
              It seems you have succeed in deploying a simple seam app in oc4j???
              How to do it???
              There is a glassfish example pulished by seam release. but it can't work in oc4j, how to do it???
              Can you or anybody send me a simple seam app that can work in oc4j???
              (xiaocase_1528@163.com)
              It's very important to me!!

              Thanks a lot!!!

              • 4. Re: JBoss Seam and Web Services using OC4J stack
                manuel.guerrero

                I have solved several problems while deploying my application, so can you tell me what kind of problems do you have? Some error, stack traces, etc?

                Now I am deploying it as a WAR file, not EAR, but one of these days I will need an EAR deployed.

                Please tell me.
                Manuel Guerrero.

                • 5. Re: JBoss Seam and Web Services using OC4J stack

                  Manuel--

                  I too need to make a Seam app run on oc4j. Currently, I have an app running on Tomcat (using JBoss's embedded EJB jar) and I try to deploy it to oc4j and it gives me the following error:

                  16:09:24,140 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
                  16:09:24,140 INFO [SettingsFactory] Query language substitutions: {}
                  16:09:24,140 INFO [SettingsFactory] Second-level cache: enabled
                  16:09:24,140 INFO [SettingsFactory] Query cache: disabled
                  16:09:24,140 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
                  16:09:24,140 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
                  16:09:24,140 INFO [SettingsFactory] Structured second-level cache entries: disabled
                  16:09:24,140 INFO [SettingsFactory] Echoing all SQL to stdout
                  16:09:24,140 INFO [SettingsFactory] Statistics: disabled
                  16:09:24,140 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
                  16:09:24,140 INFO [SettingsFactory] Default entity-mode: pojo
                  16:09:24,187 INFO [SessionFactoryImpl] building session factory
                  16:09:24,656 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configure
                  d
                  16:09:24,671 INFO [SchemaExport] Running hbm2ddl schema export
                  16:09:24,671 INFO [SchemaExport] exporting generated schema to database
                  16:09:27,875 INFO [SchemaExport] Executing import script: /import.sql
                  16:09:27,968 INFO [SchemaExport] schema export complete
                  16:09:27,968 INFO [NamingHelper] JNDI InitialContext properties:{}
                  07/03/09 16:09:28 oracle.oc4j.admin.internal.DeployerException: [lunchvote:jboss-seam-lunchvote] - E
                  xception creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePe
                  rsistence for persistence unit lunchvoteDatabase.
                  07/03/09 16:09:28 at com.evermind.server.ejb.exception.DeploymentException.exceptionCreatingEn
                  tityManagerFactory(DeploymentException.java:130)
                  07/03/09 16:09:28 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.createCont
                  ainerEntityManagerFactory(PersistenceUnitManagerImpl.java:197)
                  07/03/09 16:09:28 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initialize
                  PersistenceUnit(PersistenceUnitManagerImpl.java:159)
                  07/03/09 16:09:28 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initialize
                  (PersistenceUnitManagerImpl.java:86)
                  07/03/09 16:09:28 at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:733)
                  
                  07/03/09 16:09:28 at com.evermind.server.ApplicationStateRunning.getHttpApplication(Applicatio
                  nStateRunning.java:414)
                  07/03/09 16:09:28 at com.evermind.server.Application.getHttpApplication(Application.java:571)
                  07/03/09 16:09:28 at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createH
                  ttpApplicationFromReference(HttpSite.java:1990)
                  07/03/09 16:09:28 at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(
                  HttpSite.java:1909)
                  07/03/09 16:09:28 at com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1606)
                  07/03/09 16:09:28 at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplication
                  Binder.java:238)
                  07/03/09 16:09:28 at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplication
                  Binder.java:99)
                  07/03/09 16:09:28 at oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDepl
                  oyer.java:547)
                  07/03/09 16:09:28 at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeploy
                  er.java:202)
                  07/03/09 16:09:28 at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
                  07/03/09 16:09:28 at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4
                  JDeployerRunnable.java:52)
                  07/03/09 16:09:28 at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerR
                  unnable.java:81)
                  07/03/09 16:09:28 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Releasabl
                  eResourcePooledExecutor.java:298)
                  07/03/09 16:09:28 at java.lang.Thread.run(Thread.java:595)
                  2007-03-09 16:09:28.031 NOTIFICATION Application Deployer for lunchvote FAILED.
                  2007-03-09 16:09:28.031 NOTIFICATION Application UnDeployer for lunchvote STARTS.
                  2007-03-09 16:09:28.046 NOTIFICATION Removing all web binding(s) for application lunchvote from all
                  web site(s)
                  2007-03-09 16:09:28.453 NOTIFICATION Application UnDeployer for lunchvote COMPLETES.
                  07/03/09 16:09:28 WARNING: DeployerRunnable.run [lunchvote:jboss-seam-lunchvote] - Exception creatin
                  g EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersistence for pe
                  rsistence unit lunchvoteDatabase.oracle.oc4j.admin.internal.DeployerException: [lunchvote:jboss-seam
                  -lunchvote] - Exception creating EntityManagerFactory using PersistenceProvider class org.hibernate.
                  ejb.HibernatePersistence for persistence unit lunchvoteDatabase.
                   at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:126)
                   at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnabl
                  e.java:52)
                   at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
                  
                   at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledE
                  xecutor.java:298)
                   at java.lang.Thread.run(Thread.java:595)
                  
                  07/03/09 16:09:28 SEVERE: ProgressObjectImpl.reportError [lunchvote:jboss-seam-lunchvote] - Exceptio
                  n creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersisten
                  ce for persistence unit lunchvoteDatabase.oracle.oc4j.admin.jmx.shared.exceptions.InternalException:
                   [lunchvote:jboss-seam-lunchvote] - Exception creating EntityManagerFactory using PersistenceProvide
                  r class org.hibernate.ejb.HibernatePersistence for persistence unit lunchvoteDatabase.
                   at oracle.oc4j.admin.jmx.shared.deploy.NotificationUserData.<init>(NotificationUserData.java
                  :107)
                   at oracle.oc4j.admin.internal.Notifier.reportError(Notifier.java:429)
                   at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:123)
                   at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnabl
                  e.java:52)
                   at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
                  
                   at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledE
                  xecutor.java:298)
                   at java.lang.Thread.run(Thread.java:595)
                  Caused by: oracle.oc4j.admin.internal.DeployerException: [lunchvote:jboss-seam-lunchvote] - Exceptio
                  n creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersisten
                  ce for persistence unit lunchvoteDatabase.
                   at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:126)
                   ... 4 more
                  



                  I didn't change anything...will JBoss's embedded EJB jar even work in OC4J? In any case, I have no clue how to swap it out for Oracle's equivalent, and OC4J probably has some other configuration tasks to do. Any direction would be awesome.

                  Thanks,

                  --Rich

                  • 6. Re: JBoss Seam and Web Services using OC4J stack
                    gavin.king

                    Oracle has its own EJB3 implementation, you should use that, not E-EJB3.

                    • 7. Re: JBoss Seam and Web Services using OC4J stack
                      zoetsekas

                      i have the same problem making a hibernate persistence working on OC4J,made my own Web Test Application. Does anyone know what to do and if there are some application samples that work on OC4J 10.1.3.2 with Hibernate persistence 3.2?