2 Replies Latest reply on Apr 22, 2007 10:52 AM by theface

    How to develop my first web app with seam,without EJB,withou

    theface

      Hi,all.
      can you help me to develop my first web app,with seam,but without EJB and any DataBase(or called Datasource),Thanks very much at first.
      I used the seam command to generate a project,but i think the folder structure is too bad,so i change the todo example to project login:

      login
      -src
      --org.jboss.seam.example.todo.Login.java
      -web
      --index.html
      --login.jsp
      --WEB-INF
      ---web.xml
      ---components.xml
      ---faces-config.xml
      ---lib
      ----All lib from example folder(size is 23MB)---

      and following is changed file:
      ----------------components.xml-----------------------------
      <!DOCTYPE components PUBLIC
      "-//JBoss/Seam Component Configuration DTD 1.2//EN"
      "http://jboss.com/products/seam/components-1.2.dtd">





      -----------faces-config.xml-----------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE faces-config
      PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
      <faces-config>

      </faces-config>

      I deployed this project to tomcat 5.5,and startup the sever.no exception throws,but when to show this page use /login/login.seam.the sever will throw many exception likes follow:
      21:29:28,453 ERROR [ExceptionFilter] could not roll back transaction
      javax.naming.NamingException: Local server is not initialized
      at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
      at javax.naming.InitialContext.init(InitialContext.java:223)
      at javax.naming.InitialContext.(InitialContext.java:197)
      at org.jboss.seam.util.Naming.getInitialContext(Naming.java:35)
      at org.jboss.seam.util.Naming.getInitialContext(Naming.java:47)
      at org.jboss.seam.util.Transactions.getUserTransaction(Transactions.java:149)
      at org.jboss.seam.util.Transactions.isUTTransactionActiveOrMarkedRollback(Transactions.java:122)
      at org.jboss.seam.util.Transactions.isTransactionActiveOrMarkedRollback(Transactions.java:50)
      at org.jboss.seam.web.ExceptionFilter.rollbackTransactionIfNecessary(ExceptionFilter.java:128)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
      at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
      at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
      at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
      at java.lang.Thread.run(Thread.java:619)

      but the login form is display in browser.

      My english is too bad.so .I hope anyone can knows my means.
      Thanks again.

        • 1. Re: How to develop my first web app with seam,without EJB,wi
          christian.bauer

           


          I used the seam command to generate a project,but i think the folder structure is too bad,so i change the todo example to project login:


          Well, obviously the problem is here. Did the seam-gen produced project work? If yes, don't change it just because you don't like it. At least, make a small change then re-test and find out if what you did worked. Don't change everything at once and then work backwards.


          • 2. Re: How to develop my first web app with seam,without EJB,wi
            theface

            Thanks to your post at first.
            I am sorry.I have no spell out.
            When i generate a project use seam-gen.It can but deploy to JBoss AS,ant it work fine.but this project has many file,so i did some change with the todo example.
            and the old style of components.xml is:


            todo.jpdl.xml



            when i delete the microcontainer define .it work fine too.so i thought the problem is Jbpm define.I don't know it will do what something at Jbpm init.but i know it will use datasource .
            the classes folder contains following files:

            jboss-beans.xml
            .gpd.todo.jpdl.xml
            components.properties
            hibernate.cfg.xml
            jbpm.cfg.xml
            seam.properties
            todo.jpdl.xml

            I deleted jboss-beans.xml,it work no any exceptions.
            I deleted components.properties and seam.properties.it work fine.
            the three files jbpm.cfg.xml,.gpd.todo.jpdl.xml,jbpm.cfg.xml will used by jbpm.so i delete jbpm define from components.xml,and deleted the three files.but it dose not work.
            I need help to how to config this file.I readed the seam reference ,but i can't found any ideas can solve my problem.


            thank you again.