From: <kem...@ya...> - 2004-07-13 20:13:02
|
Isso é um erro de configuracao do teu contexto. No arquivo em que vc configurou o datasource vc configurou a transação? Vc está usando o contexto /jolt ou outro contexto para tua aplicação? se vc estiver usando outro, entao terá que configurar além do datasource o controle transacional no arquivo XML de configuracao do contexto (normalmente em TOMCAT-HOME/webapps/nome-contexto.xml Vc deve colocar esse pedaco de configuracao no seu xml de configuracao do contexto. <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"/> <ResourceParams name="UserTransaction"> <parameter> <name>factory</name> <value>org.objectweb.jotm.UserTransactionFactory</value> </parameter> <parameter> <name>jotm.timeout</name> <value>60</value> </parameter> </ResourceParams> Kemmel. --- Robson de Freitas Sampaio <rfs...@po...> escreveu: > Caros Fredson e Kemmel. > > Fiz tudo que vocês falaram e ainda não consigo > executar meu select e renderizar em > JSP, eis o erro que obtenho do container: > > ------------------------------------------------- > [DEBUG] 15:54:18 - StepExtension JavaClass called : > org.jbanana.jolt.metamodel.parse.ExtentionSQL > [WARN ] 15:54:18 - > Lendo:jbananaResourceHolderJndi.properties > [WARN ] 15:54:18 - Default instance > [DEBUG] 15:54:18 - Using standard time out for > transactions. > [DEBUG] 15:54:18 - Instructions > "/jolt/jbTeste/selectUSR.xml" was loaded. > [FATAL] 15:54:18 - The java:comp/UserTransaction > Resource is null > [FATAL] 15:54:18 - You must configure > java:comp/UserTransaction Resource inside the > DataSource Resource Configuration > [FATAL] 15:54:18 - You must put the jotm.jar or the > Distributed Transaction > Resource jar inside the Application Server lib > directory > ------------------------------------------------- > > Mais abaixo na pilha aparece: > > ------------------------------------------------- > javax.naming.NamingException: Cannot create resource > instance > at > org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:157) > at > javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301) > ------------------------------------------------- > ------------------------------------------------- > [FATAL] 15:54:18 - > org.jbanana.exceptions.JBananaException: > javax.naming.NamingException: Cannot > create resource instance > at > org.jbanana.jolt.metamodel.parse.InstructionProcessor.process(InstructionProcessor.java:68) > at > org.jbanana.jolt.metamodel.parse.ExtentionSQL.getXMLData(ExtentionSQL.java:45) > ------------------------------------------------- > > Pelo que pude entender é como se houvesse algum > problema na conexão com meu > Datasource ou com o controle de transação usado pelo > Jolt, ambos definidos no > arquivo "jolt.xml", entretanto a única coisa que > alterei nesse arquivo foi a adição > de um novo Datasource para o meu BD. Quando executei > o mesmo select direto no Jolt > utilizando o Mapper default e o referido Datasource > criado, tudo funcionou > perfeitamente. O arquivo "jotm.jar" citado acima > encontra-se no local indicado pela > instalação do Jolt. > > Sinceramente, não sei o que pode estar acontecendo, > será que devo instalar o Jolt > novamente, e mais uma dúvida, que arquivos *.jar, > realmente necessários, devo ter > no "WEB-INF/lib" da minha aplicação? > > Mais uma vez agradecendo a atenção, > > Robson Sampaio. > > > > Valeu Fredson!!! > > > > As coisas funcionam exatamente como o Fredson > comentou. > > > > Quando vc faz um requisição post ou get HTTP para > o Servlet do JBanana no servidor > > vc necessariamente tem que passar uma parametro > para o servidor chamado > > ServletState (esse parametro http é obrigatório e > indica para o JBanana qual > > StepExtension ele tem que executar.... > > > > Quando vc usa o Jolt integrado com o JBanana, vc > obrigatoriamente tem que passar > > dois parametros HTTP para o servidor: o > ServletState para o JBanana poder ser achar > > no arquivo WEB-INF/jbanana-workflow.xml e o > parametro sqlFile para que o Jolt saiba > > qual XML ele deve ler e executar no banco de > dados. > > > > ex: > > > http://meuhost:8080/JBananaController?ServletState=10&sqlFile=/queries/consulta.xml > > > > isso indica que quando a requisicao chegar no > servidor o JBanana irá executar o > > StepExtension numer > o 10 configurado no WEB-INF/jbanana-workflow.xml e o > Jolt irá > > ler o arquivo consulta.xml LOCALIZADO no diretório > /queries da sua máquina para > > executar a consulta no banco. > > > > No teu JSP que deverá ser invocado após isso (vc > deverá configurar corretamente o > > WEB-INF/jbanana-view.xml para isso) vc deverá ler > do request o bean retornado pelo > > Jolt. > > > > > > Kemmel. > > > > > > > > > > > > > > > > > > > > > > > > > > FREDSON VIEIRA COSTA <fr...@uf...> wrote: > > Bem, primeiramente Robson, vc já deve saber que o > Jolt funciona como um Step > > do JBanana. Vc deverá passar um parâmetro d uma > página para outra no teu JSP > > com o nome: sqlFile; e seu valor como: path do teu > arquivo XML. > > Lembrando que no teu arquivo Workflow.xml tu deve > colocar uma extensão no Step > > que irá mostrar teu resultado como: > > > > > > > > Por final, para vc renderizar os dados, dê uma > olhada na classe > > org.jbanana.jolt.metamodel.map.beans.BeanResultSet > do pacote Jolt. > > > > Veja se isso lhe ajuda, qualquer dúvida estamos > ai... > > > > Fredson V. Costa > > Bacharel em Ciência da Computação > > > > ---------- Original Message ----------- > > From: "Robson de Freitas Sampaio" > > To: jba...@li..., > jba...@li... > > Sent: Tue, 13 Jul 2004 09:54:14 -0300 (BRT) > > Subject: [Jbanana-jolt] Dúvidas cruciais no uso do > JBanana + Jolt - URGENTE!!! > > > >> Caros amigos, > >> > >> Estou com algumas dúvidas cruciais para alavancar > o meu > >> desenvolvimento usando o JBanana juntamente com o > Jolt. Sou > >> iniciante no uso dos dois frameworks e para isso > criei um pequeno > >> projeto de teste que usa JSP na camada de > visualização, e para > >> testar persistência, quero fazer uma consulta > (select) em meu banco > >> de dados > >> (Oracle) retornando o seu conteúdo para uma > página JSP. Ou seja, ao > >> entrar na aplicação, existirá um link que, ao ser > clicado, gerará a > >> referida página JSP com o resultado da consulta, > coisa bem simples mesmo. > >> > >> Instalei o Jolt e no JoltGUI gerei o arquivo XML > "selectUSR.xml" com > >> o meu select. Navegando no histórico da lista vi > que para utilizar > >> JSP na visualização devemos usar como mapper a > classe > >> > "org.jbanana.jolt.metamodel.map.beans.DefaultJavaBeanMapper" > e assim > >> o fiz. > >> > >> Eis as minhas dúvidas: > >> > >> 1) Como direi ao JBanana para usar o meu arquivo > XML (selectUSR.xml) > >> gerado pelo Jolt; 2) Como devem ficar os meus > arquivos jbanana- > >> workflow.xml e jbanana-view.xml para inplementar > esse teste; 3) Como > >> faço para renderizar os dados na página JSP > navegando no bean. > === message truncated === ===== ------------------------------ Kemmel da Silva Scopim ke...@jb... http://www.jbanana.org Projeto JBanana _______________________________________________________ Yahoo! Mail agora com 100MB, anti-spam e antivírus grátis! http://br.info.mail.yahoo.com/ |