1 Reply Latest reply on Dec 4, 2002 11:39 PM by vickyk

    java.lang.ClassCastException

    srshende

      Hello,
      Thanks for the reply. Can you let me know what this project.ear is ?? Is it a directory or a file. If its a directory then should I create project.war as subdir inside project.ear. In this case in which directory should I keep my ejb jar files ? in ..\deploy or WEB-INF\lib ???? and what if I have some helper classes which are used by both servlets and EJB. should I club those in a jar or can I keep those on local system. Please elaborate properly.
      at present my application has following components. all in parallel on local side
      |
      |-dataobjects
      |-helperclasses
      |-EJB

      and
      jsp
      WEB-INF
      |-web.xml
      |-classes
      |
      |-serlvet classes

      Now my dataobjects are accessed byb both EJB as well as servlet classes. So can you suggest me some good dir structure where all my war and jar files can access eachother. Awaiting your reply

      ~Sanjay

        • 1. Re: java.lang.ClassCastException
          vickyk

          > Hello,
          > Thanks for the reply. Can you let me know what this
          > project.ear is ?? Is it a directory or a file.
          This can be a directory or a ear file.
          >If
          > its a directory then should I create project.war as
          > subdir inside project.ear. In this case in which
          > directory should I keep my ejb jar files ?
          It should be placed seperately.
          >in
          > ..\deploy or WEB-INF\lib ???? and what if I have
          > some helper classes which are used by both servlets
          > and EJB. should I club those in a jar or can I keep
          > those on local system. Please elaborate properly.
          > at present my application has following components.
          > all in parallel on local side
          > |
          > |-dataobjects
          > |-helperclasses
          > |-EJB
          >
          > and
          > jsp
          > WEB-INF
          > |-web.xml
          > |-classes
          > |
          > |-serlvet classes
          >
          > Now my dataobjects are accessed byb both EJB as well
          > as servlet classes. So can you suggest me some good
          > dir structure where all my war and jar files can
          > access eachother. Awaiting your reply
          >
          > ~Sanjay
          >
          Ok ! I will expalin the details

          +Project.ear
          + MyWebapp.war
          + myjsp(directory)
          +WEB-INF
          .web.xml
          + classes(for beans)
          + lib(for library classes)
          + Myejb.jar
          + com(home,remote,ejb classes)
          + META-INF
          .ejb-jar.xml
          .
          .
          .
          + META-INF
          application.xml

          This is the structure you have to follow,and place the common classes used in the ejb and servlet in the lib.For more details refer to the J2EE classloading mechanism,you will get lots of document on google.
          Regards
          Vicky