Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Trying to integrate SmartGWT java server with JBoss AS 7

    I am using the released version of SmartGWT 2.5 evaluation. Our target is JBoss EAP 6, but while we wait we are using AS 7 which is what it will be based on.

    I would like to be able to use the SDK tools on this server, however everytime I try to launch the Visual Builder I always get the same error that /WEB-INF/iscTaglib.xml cannot be found. Going through the SmartClient documentation I found that JBoss AS 4 is the last supported version for SmartClient. Understanding that SmartGWT's java server is really SmartClient I am wondering what exactly is different in JBoss since version 4. It appears that many of you're dependencies are a bit outdated. The taglib declares its version 1.1 although the current release is 2.0. JBoss AS 7 provides Apache's Http Components libraries which replace commons-httpclient, that your software depends on, however trying to use the new libraries results in runtime exceptions. This is easily remedied by adding the commons-httpclients library as a module to JBoss AS 7, and declaring a dependency to it. What I am hoping is that perhaps fixing the SDK tools is an easy fix as well.

    Here is what I have in code:

    sgwt.gwt.xml


    Clearly looking at the stacktrace this is not a SmartGWT issue but an issue with the JSP servlet not understanding where to be looking for the file. I found that in JBoss 6 the file could successfully be found if placed in root.war/WEB-INF. AS 7 however has no root.war to speak of...but clearly somehow it does not understand that it needs to be looking under the context of the sgwt.war. I have been trying for many hours to sort this one out so any help you could provide would be greatly appreciated.
    Last edited by jpappalardo; 24 Sep 2014, 09:45.

    #2
    Interesting timing, we just recently ran into the same JBoss AS7 issue. As far as we have been able to determine, JBoss may have dropped support for war-specific taglibs, or at least for the .xml extension, or at any rate they broke a typical way of doing this.

    In the meantime:

    1. we were able to get this to work by renaming taglib.xml to taglib.tld and modifying web.xml to refer to it as /WEB-INF/taglib.tld

    2. there appear to be JBoss instructions here for installing a global taglib if the per-war taglib approach doesn't work.

    Please let us know which approach works for you, we will likely be putting a warning in the docs to help other JBoss users.

    Comment


      #3
      Thank you for the expedient response.

      I have tried renaming the file to a tld, resulting in the following error:



      I have searched all of the jars in the lib directory and have been unable to find a LoadAssemblyTag class anywhere. I tried downloading SmartClient 8.0 to see if maybe a jar got abridged in SmartGWTEE. But that has led me nowhere as well. I will begin attempting the second approach while await some feedback as to where this class may be found.

      *EDIT*

      I found LoadAssemblyTag but not on the class path JBoss is searching for. I found it in com.isomorphic.taglib.LoadAssemblyTag. I'm not quite sure how to make JBoss understand this.
      Last edited by jpappalardo; 24 Sep 2014, 09:45.

      Comment


        #4
        I'm successfully using SC8 (not SGWT) in AS7. I dropped the jsp-config section of web.xml, renamed /WEB-INF/iscTaglib.xml to iscTaglib.tld (actually copied so both exist), then changed the header of my index.jsp:
        Code:
        <%@ taglib uri="/WEB-INF/iscTaglib.tld" prefix="isomorphic"%>
        It's working great so far. Hope this helps you with your SGWT issue.

        Comment


          #5
          I found the error. Line 55 of iscTaglib:

          Code:
          <tag>
              <name>loadAssembly</name>
              <tagclass>com.isomorphic.assembly.LoadAssemblyTag</tagclass>
              <bodycontent>JSP</bodycontent>
              <attribute>
                <name>url</name>
                <required>true</required>
                <rtexprvalue>true</rtexprvalue>
              </attribute>
            </tag>
          I changed assembly to taglib and all is well.

          Comment


            #6
            Aha, so the problem appears to be that JBoss aggressively validates and blows up (even though it's for an internal tag that shouldn't have affected your deployment), then misreports the cause...

            Can you confirm that having edited iscTaglib.xml, it was *not* necessary to rename it to .tld or make any other changes?

            Comment


              #7
              JBoss AS 7 fails to see to see the taglib as a .xml, with or without an entry in web.xml. In AS 7 the web.xml is pretty much obsolete with the use of Servlet 3.0 and @WebService and @WebFilter annotations. However, as a .tld JBoss realizes there is a taglib whether or not it is defined in web.xml, and verifies that the classes referenced by it are on the classpath.

              Comment


                #8
                Hi,

                Just as point of interest, loose TLD files have not been needed since J2EE1.3 which was servlet 2.3. The servlet 2.4 (J2EE1.4) implementations scan the jar files for TLD files and the taglib uri is http based such as the following.

                Code:
                <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
                <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
                <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
                <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
                <%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
                <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
                These entries come from the TLD file in side the implementing jar and are used for taglib uri validation in Eclipse for example. Putting the wrong URI will show a validation error in Eclipse and will not work when the JSP compiles.
                With this setup no entries such as jsp-config are needed in the web.xml file except for really old jar files without the more current packaging.

                Hope this is useful.

                Comment


                  #9
                  Good info, however, can you suggest an arrangement of files that is correct for both servlets 2.3 and 2.4? JBoss seems to be ignoring servlets 2.3-style taglib declarations - by your reading of the spec is it correct to do so?

                  Comment


                    #10
                    I looked at the Servlet 3.0 and JSP 2.1 specs and I don't see any change that would make it not work but I did find the following:
                    Code:
                    <%@ taglib ( uri=”tagLibraryURI” | tagdir=”tagDir” ) prefix=”tagPrefix” %>
                    So it looks like tagdir attribute should be used rather than uri.

                    I also found these changes when upgrading from SmartClient version 7rc2 to version 8.

                    a. <isomorphic:loadAssembly url=... becomes URI=...
                    b. <isomorphic:loadISC add an attribute isomorphicURI="isomorphic/" this will remove a warning

                    Overall though I think because J2EE has been moving to configuration by exception that the TLD file should be packaged in the jar with URI entries according to the SPEC for taglib packaging. This helps the following:

                    1. Eliminates the need for a web.xml entry.
                    2. Eliminates errors in tools such as Eclipse due to the taglib uri being correctly set and matching the TLD entries.

                    The downside is that people will have to change their taglib entries in their JSPs but that is an easy and safe change even for hundreds of JSPs. But if they are changing J2EE containers or upgrade to SC 8.1 or later then this should be a small concern.

                    For older J2EE installations, the TLD file can be extracted from the JAR and referenced in web.xml as usual.

                    Comment


                      #11
                      So I have the taglib setup as a .tld, is there something I can modify in the smartgwt jars (I am using power edition) so that everytime I build the index.jsp references .tld instead of .xml? I am assuming that the file is just copied from a jar somewhere?

                      Comment


                        #12
                        Sorry not quite following the question - the taglib file is in war/WEB-INF/classes in the sample projects if that helps.

                        Comment


                          #13
                          Everytime a gwt compile takes places index.jsp gets rewritten. Since I had to change the taglib to a .tld rather than a .xml, when I try to launch visual builder it crashes because it is searching for .xml rather than .tld. So After every build I have to edit index.jsp in order to launch visual builder. I am assuming that index.jsp is bundled in one of your jars, and is just copied to sc/tools folder. So I would like to be able to edit that file once, and it just be permanently fixed so that I can run visual builder in JBoss AS 7.

                          Comment


                            #14
                            We're aware you have JBoss support - probably the best thing is to ping them about why they are not supporting a taglib .xml file since this is not an obsolete or deprecated format as far as we can tell.

                            Files that are part of Visual Builder are inside smartgwtee.jar - the directories are arranged just like the GWT module names that you inherit from your .gwt.xml, with resources that get copied into webroot under a subdirectory "public/" (just standard GWT module stuff).

                            Comment

                            Working...
                            X