1 2 Previous Next 22 Replies Latest reply on May 7, 2006 8:21 PM by mingliou Go to original post
      • 15. Re: JNDI-problem with Tutorial

         

        "plieger" wrote:
        This explains why you have to leave it blank, everything is found relative to the class directory Tutorial/bin.


        After reconcidering a while, I think this is not the real reason, because the prefix indicates where the classfiles are in the .war file... So somewhere else down the line there is a discrepancy, perhaps in the web.xml file?

        <ejb-ref >
        <![CDATA[Reference to the Fibo EJB]]>
        <ejb-ref-name>ejb/Fibo</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        tutorial.interfaces.FiboHome
        tutorial.interfaces.Fibo
        </ejb-ref>

        Well, I'm not sure, just starting my way into this wonderful world of EJB's :-)

        • 16. Re: JNDI-problem with Tutorial
          rigriff

          I am sure that I am beating a dead horse with this, but...

          Following the tutorial for 1.4 to the letter with the exception of using the new Standard Packaging Entries for ear's, war's and jar's (modified to gather the appropriate classes) and dropping a MANIFEST.MF into META-INF.

          I run into the ClassCast Exception

          on windows XP sp 2

          JDK 1.5.6
          JBoss 4.0.3sp1
          JBoss-IDE 1.5RC1

          but not under linux (2.6.11)

          JDK 1.5.2
          JBoss 4.0.3sp1
          JBoss-IDE 1.5RC1

          This isn't an apples to apples comparison, but the approach and handling by IDE's and JBoss should be equal b/t systems.

          What gives? Is it the JDK version?

          • 17. Re: JNDI-problem with Tutorial

            Could you paste the entire exception so we can get a better idea of where it is occuring?

            • 18. Re: JNDI-problem with Tutorial
              nholbrook

              How do we get away from the ClassCastException when the war isn't packaged inside the ear? Anybody have any insight here yet?

              • 19. Re: JNDI-problem with Tutorial
                jbossxx0

                I tried removing the WEB-INF/classes and Changing URL be "java:com/env/ejb/Fibo".

                But it is still giving me the same error.

                Can anybody help?

                • 20. Re: JNDI-problem with Tutorial
                  nholbrook

                  I changed the Isolated property to false inside the ear-deployer.xml. I also needed to modify the classloader options in the file jbossweb-tomcat55.sar/META-INF/jboss-service.xml. There is a flag UseJBossWebLoader and Java2ClassLoadingCompliance that I believe affect classloading. I changed these to false. I'm not completely sure what affect this can have, only that I can now deploy a war outside of my ear and get them to play nice again. Hope this helps to at least point somebody in the right direction.

                  • 21. Re: JNDI-problem with Tutorial
                    m_vdb

                    This solution worked.. Now the whole project is running.. Thank you for this posting =)

                    "sherwinds" wrote:
                    check this out: JBossIDE Tutorial 1.4, page 34, section 9.3, start from 3rd paragraph.

                    Verify if you followed this tutorial and notice the 6th paragraph where it says:

                    "The classes must be located under the WEB-INF/classes of the War package. Set the prefix to WEB-INF/classes."

                    You can try to remove the entry on Prefix, it should be blank, and try to run Packaging again and re-deploy your FiboApp.ear and try Fibo again.

                    Hopes this help. Mine is now working after 3 days of almost on the brink of insanity.

                    S

                    My current config:

                    OS: WXP SP4
                    JBossIDE: JBossIDE-1.5M1-jre15-win32.zip
                    Java: 1.5.0_3


                    • 22. Re: JNDI-problem with Tutorial
                      mingliou

                      The only workaround works for my env (JBoss 4.0.3 SP1 & jdk 1.5.0_06) is
                      Object ref = context.lookup("ejb/Fibo");

                      Removing WEB-INF/classes from packaging configuration doesn't work for me at all.

                      1 2 Previous Next