[RESOLVIDO] Oracle ADF sem ADF Faces?

Olá pessoal,

estou procurando uma forma de utilizar os components de negócio do ADF (EntityObject, ViewObject, ApplicationModule, etc…) sem utilizar a camada de view (ADF Faces, bindings, etc…). Mais especificamente, gostaria de, por exemplo, conseguir instanciar os AppModule e utilizá-los em páginas JSP, ou até implementar uma espécie de conector para criar interfaces em Flex e chamar os métodos dos AppModules usando BlazeDS.

Já procurei informações sobre lookup, classes de contexto e afins mas ainda não consegui fazer nenhum exemplo funcionar.

No exemplo abaixo, configurando o filtro ADFBindingFilter no web.xml eu consigo um objeto BindingContext válido, mas não consigo uma instância do DCDataControl:

oracle.adf.model.BindingContext bc = oracle.adf.model.servlet.HttpBindingContext.getContext(request); oracle.adf.model.binding.DCDataControl dc = bc.findDataControl("AppModuleDataControl");

Ao executar a segunda linha:

[code]oracle.classloader.util.AnnotatedNoClassDefFoundError:
Classe não encontrada: oracle.jdeveloper.cm.ConnectionManager
Classe dependente: oracle.jbo.client.Configuration
Carregador: default.root:0.0.0
Origem do Código: /C:/Jdev/jdevbin/BC4J/lib/bc4jct.jar
Configuração: in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/application.xml
A classe não encontrada está disponível nos seguintes locais:

  1. Origem do Código: /C:/Jdev/jdevbin/jlib/jdev-cm.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml)
    Esta origem de código está disponível no carregador adf.oracle.domain:10.1.3.1. Esta biblioteca compartilhada pode ser importada pela aplicação “default”.
    Esta origem de código está disponível no carregador adf.generic.domain:10.1.3.1. Esta biblioteca compartilhada pode ser importada pela aplicação “default”.
    Esta origem de código está disponível no carregador current-workspace-app.web.TestesADF-BlazeADF-webapp:0.0.0. Este é um filho do carregador dependente default.root:0.0.0.

at oracle.classloader.PolicyClassLoader.handleClassNotFound (PolicyClassLoader.java:2068) [/C:/Jdev/jdevbin/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@14916158] at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1679) [/C:/Jdev/jdevbin/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@14916158] at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1635) [/C:/Jdev/jdevbin/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@14916158] at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1620) [/C:/Jdev/jdevbin/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@14916158] at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap:1.5.0_05] at oracle.jbo.client.Configuration. (Configuration.java:251) [/C:/Jdev/jdevbin/BC4J/lib/bc4jct.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at oracle.jbo.common.ampool.PoolMgr.createPool (PoolMgr.java:283) [/C:/Jdev/jdevbin/BC4J/lib/bc4jct.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at oracle.jbo.common.ampool.PoolMgr.findPool (PoolMgr.java:539) [/C:/Jdev/jdevbin/BC4J/lib/bc4jct.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at oracle.jbo.common.ampool.ContextPoolManager.findPool (ContextPoolManager.java:165) [/C:/Jdev/jdevbin/BC4J/lib/bc4jct.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at oracle.adf.model.bc4j.DataControlFactoryImpl.findOrCreateSessionCookie (DataControlFactoryImpl.java:136) [/C:/Jdev/jdevbin/BC4J/lib/adfm.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession (DataControlFactoryImpl.java:222) [/C:/Jdev/jdevbin/BC4J/lib/adfm.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at oracle.adf.model.binding.DCDataControlReference.getDataControl (DCDataControlReference.java:76) [/C:/Jdev/jdevbin/BC4J/lib/adfm.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at oracle.adf.model.BindingContext.get (BindingContext.java:457) [/C:/Jdev/jdevbin/BC4J/lib/adfm.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at oracle.adf.model.BindingContext.findDataControl (BindingContext.java:308) [/C:/Jdev/jdevbin/BC4J/lib/adfm.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at _pagina._jspService (_pagina.java:56) [/C:/Jdev/jdevhome/jdev/mywork/TestesADF/BlazeADF/public_html/WEB-INF/classes/.jsps/ (from *.jsp in C:\Jdev\jdevhome\jdev\mywork\TestesADF\BlazeADF\public_html\WEB-INF\classes.jsps), by current-workspace-app.web.TestesADF-BlazeADF-webapp.jsp30247927:0.0.0] at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.1.0) ].http.OrionHttpJspPage.service (OrionHttpJspPage.java:59) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.jsp.runtimev2.JspPageTable.service (JspPageTable.java:453) [/C:/Jdev/jdevbin/j2ee/home/lib/ojsp.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.jsp.runtimev2.JspServlet.internalService (JspServlet.java:591) [/C:/Jdev/jdevbin/j2ee/home/lib/ojsp.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.jsp.runtimev2.JspServlet.service (JspServlet.java:515) [/C:/Jdev/jdevbin/j2ee/home/lib/ojsp.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at javax.servlet.http.HttpServlet.service (HttpServlet.java:856) [/C:/Jdev/jdevbin/j2ee/home/lib/servlet.jar (from (ignore manifest Class-Path) in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by api:1.4.0] at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ResourceFilterChain.doFilter (ResourceFilterChain.java:64) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.adf.model.servlet.ADFBindingFilter.doFilter (ADFBindingFilter.java:162) [/C:/Jdev/jdevbin/BC4J/lib/adfm.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.EvermindFilterChain.doFilter (EvermindFilterChain.java:15) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.adf.model.servlet.ADFBindingFilter.doFilter (ADFBindingFilter.java:162) [/C:/Jdev/jdevbin/BC4J/lib/adfm.jar (from in /C:/Jdev/jdevhome/jdev/system/oracle.j2ee.10.1.3.39.81/embedded-oc4j/config/server.xml), by default.root:0.0.0] at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke (ServletRequestDispatcher.java:619) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal (ServletRequestDispatcher.java:368) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest (HttpRequestHandler.java:866) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest (HttpRequestHandler.java:448) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest (HttpRequestHandler.java:216) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run (HttpRequestHandler.java:117) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run (HttpRequestHandler.java:110) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run (ServerSocketReadHandler.java:260) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket (ServerSocketAcceptHandler.java:239) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketAcceptHandler.access$700 (ServerSocketAcceptHandler.java:34) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run (ServerSocketAcceptHandler.java:880) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run (ReleasableResourcePooledExecutor.java:298) [/C:/Jdev/jdevbin/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in C:\Jdev\jdevbin\j2ee\home\oc4j.jar), by oc4j:10.1.3] at java.lang.Thread.run (Thread.java:595) [jre bootstrap, by jre.bootstrap:1.5.0_05]

[/code]

Alguem já conseguiu fazer isso funcionar?

Você está utilizando EJB para publicar os metodos no DataControl, se sim, verifique se o mesmo foi publicado.

Abraço,

nao estou usando EJB…
valew…

consegui fazer. Usando a classe Configuration:

    public final OrdensAMImpl INSTANCE;
    
    public OrdensConnector() {
        INSTANCE = (OrdensAMImpl) Configuration
                .createRootApplicationModule(AM_FULL_NAME, AM_CONFIG_NAME);
        
    }

AM_FULL_NAME é o nome completo (com package) da classe.

AM_CONFIG_NAME é o nome de uma configuração válida para o AppModule.