Announcement

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

    SmartClient Server Integration - a little lost

    So, we just bought SmartClient 8.3 Pro, and we need to have the server-side piece for a couple of things we're doing.

    Trouble is that we develop our back end in a language other than Java, so I have absolutely no clue where to start when it comes to setting up the server side of SmartClient.

    For now, we're using the embedded server that comes with the evaluation, but I'm guessing we shouldn't deploy with that. I can't stress enough how little I know about Java, so the documentation I've read so far about how to deploy (http://www.smartclient.com/docs/8.3/a/b/c/go.html#group..iscInstall) is pretty much gibberish to me. I don't know a thing about Tomcat, and everything I've read so far seems to assume a lot about the reader understanding it.

    To make things even more interesting, we use the Sun ONE v6.1 webserver. I wish we could move to Apache, but that will probably not be an option in the timeframe we have to work with. Sun ONE seems to come with some Java server stuff, but I'm fairly lost with that too.

    So I'm looking for some advice here for the absolute simplest way to get the server side of this going, without having to stop and become an expert on Java servers. Has anyone managed to get SmartClient's server components operating on Sun ONE? If not, how difficult is it to hook up Sun ONE to Tomcat?

    Thanks,

    #2
    Start with: Where are the services you ultimately want your web application to connect to, and how is this Sun One server involved?

    Comment


      #3
      Services

      We're using Progress WebSpeed as the back end for our datasources. The only thing we need the SmartClient server for at the moment is the printable view and the "export to excel" functionality, but we may use charts eventually.

      Sun One is the webserver in use, and we connect to WebSpeed through it via NSAPI, but it would just as easily work as CGI.

      So basically, if we could have something as self-contained and easy to install as the embedded server that is used for the SmartClient demo, that would work fine for us, since we won't have any additional java pieces or customizations to add.

      Thanks.

      Comment


        #4
        OK, what you most likely want to do is to deploy the smartclientRuntime folder as a .war on Sun ONE. Sun ONE is a bit old but you should find instructions for how to do this.

        You literally just .zip the smartclientRuntime folder and rename it to .war.

        Before doing so however, copy over all of the .jar file from smartclientSDK/WEB-INF/lib - these are server side libraries that are required for things like Excel export.

        Comment


          #5
          Web.xml file messed up

          Thanks for the info. I'm working on this today.

          Still having difficulties - mostly because I really don't have any idea how JSP or any of that works. I've managed to create the war file and get it to deploy to Sun One (v.6.1)

          But the server will not start it, and it gives errors:

          [https-fbsudb08.fara.com]: failure (24418): ContextConfig[/scr] WEB3524: Parse error in application web.xml org.xml.sax.SAXParseException: Document root element "web-app", must match DOCTYPE root "null". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at
          (etc, etc...)


          The web.xml file seems to be the problem.

          Code:
          <!-- <?xml version="1.0" encoding="ISO-8859-1"?> -->
          <!-- <!DOCTYPE web-app PUBLIC 'http://java.sun.com/xml/ns/j2ee' 'http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd'>
          -->
          <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
                    version="2.4">
          ...
          The parser in the server seems to be flipping out on the syntax somehow. I've tried adding a doctype, but as you can see, I ended up commenting it out, because it caused other errors.

          Has Isomorphic ever deployed on Sun One before? If so, do you have an example web.xml file that would work? I'm not sure what I'm doing wrong here.

          Comment


            #6
            XML file problem fixed - now a Java version problem

            So, I managed to find an .xsd and web.xml combination that would work - or at least not throw the errors it was:

            Code:
            <!DOCTYPE web-app PUBLIC
                    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
                    "http://java.sun.com/dtd/web-app_2_3.dtd">
            <web-app>
                <!-- Note: The servlets/filters referenced here are documented in the SDK javadoc -->
            
                <!-- Init: initializes SmartClient framework.  Note that we invoke the Init logic from 
                     both a Listener and a load-on-startup Servlet in this file - see the client-side 
                     documentation topic "serverInit" for a discussion of this.  -->
                <listener>
                    <listener-class>com.isomorphic.base.InitListener</listener-class>
                </listener>
                <servlet>
                    <servlet-name>Init</servlet-name>
                    <servlet-class>com.isomorphic.base.Init</servlet-class>
                    <load-on-startup>1</load-on-startup>
                </servlet>
                  
                <servlet>
                    <servlet-name>HttpProxy</servlet-name>
                    <servlet-class>com.isomorphic.servlet.HttpProxyServlet</servlet-class>
                </servlet>
                <!-- The IDACall servlet handles all Built-in DataSource operations -->
                <servlet>
                    <servlet-name>IDACall</servlet-name>
                    <servlet-class>com.isomorphic.servlet.IDACall</servlet-class>
                </servlet>
            
                <!-- The RESTHandler servlet handles SmartClient Server DataSource operations issued by 
                     REST clients - it's like IDACall, but for the REST protocol.  Typically,  the clients
                     of this servlet would not be ordinary SmartClient/SmartGWT applications (though they 
                     could be), but other client technologies that need to access SmartClient DataSource 
                     operations as reusable services -->
                <servlet>
                    <servlet-name>RESTHandler</servlet-name>
                    <servlet-class>com.isomorphic.servlet.RESTHandler</servlet-class>
                </servlet>
            
                <!-- The DataSourceLoader servlet returns Javascript representations of the dataSources whose
                     ID's are passed to it - it is an alternative to using the <loadDS> JSP tag -->
                <servlet>
                    <servlet-name>DataSourceLoader</servlet-name>
                    <servlet-class>com.isomorphic.servlet.DataSourceLoader</servlet-class>
                </servlet>
            
                <!-- The screenLoader servlet loads screen definitions in javascript notation -->
                <servlet>
                    <servlet-name>screenLoader</servlet-name>
                    <servlet-class>com.isomorphic.servlet.ScreenLoaderServlet</servlet-class>
                </servlet>
            
                <!-- The FileDownload servlet downloads static files, like a webserver -->
                <servlet>
                    <servlet-name>FileDownload</servlet-name>
                    <servlet-class>com.isomorphic.servlet.FileDownload</servlet-class>
                </servlet>
            
            
            
                <!-- The PreCache servlet initializes when the servlet engine starts up and pre-loads 
                     data need for all client requests.  This is optional, and improves performance
                     of the first few page requests.  PreCache cannot be invoked by a browser, because
                     there is no "servlet-mapping" defined for it. -->
                <servlet>
                    <servlet-name>PreCache</servlet-name>
                    <servlet-class>com.isomorphic.servlet.PreCache</servlet-class>
                    <load-on-startup>2</load-on-startup>
                </servlet>
            
                <!-- RPCManager uses this URL by default for Built-in DataSource operations -->
                <servlet-mapping>
                    <servlet-name>IDACall</servlet-name>
                    <url-pattern>/isomorphic/IDACall/*</url-pattern>
                </servlet-mapping>
            
                <!-- Built-in DataSource operations backcompat -->
                <servlet-mapping>
                    <servlet-name>IDACall</servlet-name>
                    <url-pattern>/isomorphic/IDACall.aspx/*</url-pattern>
                </servlet-mapping>
            
                <!-- DataSourceLoader requests -->
                <servlet-mapping>
                    <servlet-name>DataSourceLoader</servlet-name>
                    <url-pattern>/isomorphic/DataSourceLoader</url-pattern>
                </servlet-mapping>
            
                <!-- The screenLoader servlet loads screen definitions in javascript notation -->
                <servlet-mapping>
                    <servlet-name>screenLoader</servlet-name>
                    <url-pattern>/isomorphic/screenLoader</url-pattern>
                </servlet-mapping>
            
                <servlet-mapping>
                    <servlet-name>HttpProxy</servlet-name>
                    <url-pattern>/isomorphic/HttpProxy/*</url-pattern>
                </servlet-mapping>
            
                <!-- Use FileDownload servlet to download all static content that's part of the skin, such as
                     image files, so we can set Expires headers and other cache control directives.  In a
                     production deployment, you'd want to use a webserver such as Apache to do this.  
                -->
                <servlet-mapping>
                  <servlet-name>FileDownload</servlet-name>
                  <url-pattern>/isomorphic/skins/*</url-pattern>
                </servlet-mapping>
            
                <!-- serve ISC modules compressed, with expires headers -->
                <servlet-mapping>
                    <servlet-name>FileDownload</servlet-name>
                    <url-pattern>/isomorphic/system/modules/*</url-pattern>
                </servlet-mapping>
            
                <!-- serve ISC development modules compressed, with expires headers -->
                <servlet-mapping>
                    <servlet-name>FileDownload</servlet-name>
                    <url-pattern>/isomorphic/system/development/*</url-pattern>
                </servlet-mapping>
            
                <!-- server skin assets with expires headers -->
                <servlet-mapping>
                    <servlet-name>FileDownload</servlet-name>
                    <url-pattern>/isomorphic/system/reference/skin/*</url-pattern>
                </servlet-mapping>
            
                <!-- General config -->
                <session-config>
                    <session-timeout>30</session-timeout>
                </session-config>
            
                <mime-mapping>
                    <extension>manifest</extension>
                    <mime-type>text/cache-manifest</mime-type>
                </mime-mapping>
            
            </web-app>
            The problem I'm hitting now is that Sun One is complaining about the Java version:

            Code:
            failure (27768): WebModule[/scr]: WEB2671: Error configuring application listener of class com.isomorphic.base.InitListener java.lang.UnsupportedClassVersionError: com/isomorphic/base/InitListener (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1717) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:983) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1431) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1301) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3399) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3793) at com.iplanet.ias.web.WebModule.start(WebModule.java:260) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardHost.start(StandardHost.java:652) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355) at org.apache.catalina.startup.Embedded.start(Embedded.java:995) at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431) at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500) at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
            I thought it might be caused by our Sun One server running JDK 1.4, so I for the specific virtualhost, I've set it to use this version of Java:

            Code:
            # java -version -verbose
            java version "1.5.0_18"
            Java(TM) Platform, Standard Edition for Business (build 1.5.0_18-b02)
            Java HotSpot(TM) Server VM (build 1.5.0_18-b02, mixed mode)
            Even after restarting the webserver, I keep getting the same error though. My understanding from some Google searches what that 49.0 = JDK 1.5. Again though, I can barely spell Java, so this has me quite confused.

            Comment


              #7
              Right, you need to be running JDK 1.5 or higher, and it looks like you've obtained JDK 1.5. However, it seems like your SunONE server is still using JDK 1.4, probably because somewhere in it's startup scripts it is configured to use a hardcoded JDK (maybe one shipped with SunONE).

              We don't know enough about SunONE to say definitively and it's very old - probably best to contact whoever supports that server since you have a very straightforward question to ask now ("how do I make it run JDK 1.5").

              Comment


                #8
                I'll be darned - it works!

                Finally got everything working with Sun One 6.1, and SmartClient 8.3 pro.

                The first problem I hit was the web.xml file. It has to be formatted like this:

                Code:
                <!DOCTYPE web-app PUBLIC
                        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
                        "http://java.sun.com/dtd/web-app_2_3.dtd">
                <!--  <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
                          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
                          version="2.4">-->
                <web-app>
                    <!-- Note: The servlets/filters referenced here are documented in the SDK javadoc -->
                
                    <!-- Init: initializes SmartClient framework.  Note that we invoke the Init logic from 
                         both a Listener and a load-on-startup Servlet in this file - see the client-side 
                         documentation topic "serverInit" for a discussion of this.  -->
                    <listener>
                        <listener-class>com.isomorphic.base.InitListener</listener-class>
                    </listener>
                    <servlet>
                        <servlet-name>Init</servlet-name>
                        <servlet-class>com.isomorphic.base.Init</servlet-class>
                        <load-on-startup>1</load-on-startup>
                    </servlet>
                      
                    <servlet>
                        <servlet-name>HttpProxy</servlet-name>
                        <servlet-class>com.isomorphic.servlet.HttpProxyServlet</servlet-class>
                    </servlet>
                    <!-- The IDACall servlet handles all Built-in DataSource operations -->
                    <servlet>
                        <servlet-name>IDACall</servlet-name>
                        <servlet-class>com.isomorphic.servlet.IDACall</servlet-class>
                    </servlet>
                
                    <!-- The RESTHandler servlet handles SmartClient Server DataSource operations issued by 
                         REST clients - it's like IDACall, but for the REST protocol.  Typically,  the clients
                         of this servlet would not be ordinary SmartClient/SmartGWT applications (though they 
                         could be), but other client technologies that need to access SmartClient DataSource 
                         operations as reusable services -->
                    <servlet>
                        <servlet-name>RESTHandler</servlet-name>
                        <servlet-class>com.isomorphic.servlet.RESTHandler</servlet-class>
                    </servlet>
                
                    <!-- The DataSourceLoader servlet returns Javascript representations of the dataSources whose
                         ID's are passed to it - it is an alternative to using the <loadDS> JSP tag -->
                    <servlet>
                        <servlet-name>DataSourceLoader</servlet-name>
                        <servlet-class>com.isomorphic.servlet.DataSourceLoader</servlet-class>
                    </servlet>
                
                    <!-- The screenLoader servlet loads screen definitions in javascript notation -->
                    <servlet>
                        <servlet-name>screenLoader</servlet-name>
                        <servlet-class>com.isomorphic.servlet.ScreenLoaderServlet</servlet-class>
                    </servlet>
                
                    <!-- The FileDownload servlet downloads static files, like a webserver -->
                    <servlet>
                        <servlet-name>FileDownload</servlet-name>
                        <servlet-class>com.isomorphic.servlet.FileDownload</servlet-class>
                    </servlet>
                
                
                
                    <!-- The PreCache servlet initializes when the servlet engine starts up and pre-loads 
                         data need for all client requests.  This is optional, and improves performance
                         of the first few page requests.  PreCache cannot be invoked by a browser, because
                         there is no "servlet-mapping" defined for it. -->
                    <servlet>
                        <servlet-name>PreCache</servlet-name>
                        <servlet-class>com.isomorphic.servlet.PreCache</servlet-class>
                        <load-on-startup>2</load-on-startup>
                    </servlet>
                
                    <!-- RPCManager uses this URL by default for Built-in DataSource operations -->
                    <servlet-mapping>
                        <servlet-name>IDACall</servlet-name>
                        <url-pattern>/isomorphic/IDACall/*</url-pattern>
                    </servlet-mapping>
                
                    <!-- Built-in DataSource operations backcompat -->
                    <servlet-mapping>
                        <servlet-name>IDACall</servlet-name>
                        <url-pattern>/isomorphic/IDACall.aspx/*</url-pattern>
                    </servlet-mapping>
                
                    <!-- DataSourceLoader requests -->
                    <servlet-mapping>
                        <servlet-name>DataSourceLoader</servlet-name>
                        <url-pattern>/isomorphic/DataSourceLoader</url-pattern>
                    </servlet-mapping>
                
                    <!-- The screenLoader servlet loads screen definitions in javascript notation -->
                    <servlet-mapping>
                        <servlet-name>screenLoader</servlet-name>
                        <url-pattern>/isomorphic/screenLoader</url-pattern>
                    </servlet-mapping>
                
                    <servlet-mapping>
                        <servlet-name>HttpProxy</servlet-name>
                        <url-pattern>/isomorphic/HttpProxy/*</url-pattern>
                    </servlet-mapping>
                
                    <!-- Use FileDownload servlet to download all static content that's part of the skin, such as
                         image files, so we can set Expires headers and other cache control directives.  In a
                         production deployment, you'd want to use a webserver such as Apache to do this.  
                    -->
                    <servlet-mapping>
                      <servlet-name>FileDownload</servlet-name>
                      <url-pattern>/isomorphic/skins/*</url-pattern>
                    </servlet-mapping>
                
                    <!-- serve ISC modules compressed, with expires headers -->
                    <servlet-mapping>
                        <servlet-name>FileDownload</servlet-name>
                        <url-pattern>/isomorphic/system/modules/*</url-pattern>
                    </servlet-mapping>
                
                    <!-- serve ISC development modules compressed, with expires headers -->
                    <servlet-mapping>
                        <servlet-name>FileDownload</servlet-name>
                        <url-pattern>/isomorphic/system/development/*</url-pattern>
                    </servlet-mapping>
                
                    <!-- server skin assets with expires headers -->
                    <servlet-mapping>
                        <servlet-name>FileDownload</servlet-name>
                        <url-pattern>/isomorphic/system/reference/skin/*</url-pattern>
                    </servlet-mapping>
                
                    <!-- General config -->
                    <session-config>
                        <session-timeout>30</session-timeout>
                    </session-config>
                
                    <mime-mapping>
                        <extension>manifest</extension>
                        <mime-type>text/cache-manifest</mime-type>
                    </mime-mapping>
                
                </web-app>
                It differs from the stock web-runtime.xml in a couple ways:
                1. Can't use xmlns attributes in web-app. Instead, use the doctype tag above. It's version 2.3. For some reason version 2.4 doesn't work.

                2. The <listener> tag must be ABOVE all <servlet> tags.

                3. The <jsp-config> tag must be removed. I guess it's a version thing, but Sun One doesn't like it.

                The second problem I hit was JDK version. I tried a dozen times to switch that virtualserver to a JDK 1.5 version, and "apply" the changes to Sun One. It only finally took after I completely shut down and restarted Sun One, said a little chant, and held my leg up. Cursing also helped.

                Thanks a bunch for the help on this!

                Comment


                  #9
                  Good to hear. Just for completeness, those changes to the web.xml file should not have been required (it's already correct), and it's possible that removing mention of *both* the DTD *and* the XML schema will allow you to avoid the problem.

                  It only finally took after I completely shut down and restarted Sun One, said a little chant, and held my leg up. Cursing also helped.
                  Sacrificing goats has also been widely reported to help.

                  Comment


                    #10
                    Originally posted by Isomorphic View Post
                    Good to hear. Just for completeness, those changes to the web.xml file should not have been required (it's already correct), and it's possible that removing mention of *both* the DTD *and* the XML schema will allow you to avoid the problem.
                    It's possible the 1.4 JDK's XML parser was tripping up on that. I may have to try reverting some of the XML changes one at a time and see what will work.

                    If I do, I'll update the thread for the benefit of anyone else who finds themselves in this situation.

                    Comment

                    Working...
                    X