Installing nCode oneStop Servlet on Windows

oralwideΔιακομιστές

17 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

141 εμφανίσεις

Installing nCode oneStop Servlet on Windows

1


In order to install and configure nCode One Stop Java Servlet on Windows, the following prerequisites
are required:


1.

Java 32
-
bit JDK 1.6

2.

You have installed nCode 11 versions of nCodeServer3 and nCodeWS3 on the target machine.
Alternatively, but not ideally, you have installed nCode 10 version of nCodeServer3 and
nCodeWS3 on the target machine, however, all nCode dll
-
s and data files corresp
ond to nCode
11 version. This combination is possible, since we preserve backwards compatibility with
nCodeServer3 and nCodeWS3. You need to verify that nCodeWS3, based on nCode 11 dll
-
s, is
running. Among others, you can use nCode Load Test application to

test access to nCodeServer3
and nCodeWS3. Both 32
-
bit and 64
-
bit installations are equally valid, since nCode One Stop Java
Servlet interacts with nCodeWS3 on SOAP level.

3.

Make sure that nCodeServer3.exe is in the same directory with nCode 11 dll
-
s. The lo
cation of
nCode data files must point to nCode 11 version, since nCode 11 specific features require
presence of the (latest) nCode 11 built data files(NCODEREF, NCODEPOC, GMODLIST and
GPARLIST). The nCode licence 301 is sufficient, although nCode licence 3
03 will work just as well.
If not sure, you can right click on nCode dll
-
s or exe
-
s and the properties dialog will show which
major version of nCode (10 or 11) they belong to.

4.

You are logged onto the target machine as Administrator. This is necessary, sinc
e some steps in
the installation procedure require Admin privilege. You may need to use Admin tools like Event
Viewer, Services dialog, Windows command prompt, etc.

5.

You have downloaded tomcat6.zip file, which contains the Tomcat installation folder, togeth
er
with the latest versions of nCode One Stop Java Servlet and nCode One Stop demo pages. Later,
I will point to the folders where you may need to make changes, should you wish to install a
newer version of nCode One Stop.


The installations steps should b
e the following:


A.

Unzip the tomcat6.zip file to the root of one of your drives. You do not need to choose the
system drive (C:), in my case, I have installed it to the E: drive. The system drive installation
should work also, however, I believe I ran into
some issues with system drive privileges when
making changes to the Tomcat configuration. So, your Tomcat root (aka CATALINA_HOME)
should now be <drive>
\
tomcat. Under there, you will find Tomcat binaries under the 'bin'
subfolder, the 'conf' subfolder for
Tomcat configuration, etc. From the nCode One Stop point of
view, the key subfolder is 'webapps', which contains the root folder of nCode One Stop Java
Servlet and nCode One Stop demo pages.

B.

Create a new System Environment Variable (if it does not already
exist), called 'JAVA_HOME',
containing the full path of the Java installation folder. Admin privilege is needed here. In my
case, the value was: 'C:
\
Program Files (x86)
\
Java
\
jdk1.6.0_20'. Clearly, in my case, I am using 32
-
bit 1.6 Java version, which corre
sponds to my version of Tomcat. If your Java installation is 64
-
bit, this may present a problem, since you would need to download 64
-
bit Tomcat version first
and then configure it the same way I configured the 32
-
bit Tomcat version.

C.

Copy the servlet
-
api.ja
r file to the
\
jre
\
lib
\
ext folder in the JDK root. In my case, the file was
copied from E:
\
tomcat
\
lib
\
servlet
-
api.jar to C:
\
Program Files
(x86)
\
Java
\
jdk1.6.0_20
\
jre
\
lib
\
ext
\
servlet
-
api.jar. This step is very important when compiling
Java Servlets using Ecl
ipse, I am not sure if this step is essential if using Tomcat without Eclipse.

D.

Note that my version has been configured to run Tomcat under port 18080. That is because, on
my system, IIS occupies the port 80 and Eclipse was installed with port 8080. This i
s controlled
Installing nCode oneStop Servlet on Windows

2


under the Tomcat configuration file E:
\
tomcat
\
conf
\

server.xml, and the configuration looks like
the following:




<!
--

A "Connector" represents an endpoint by which requests are received



and responses are returned. Documentation at

:



Java HTTP Connector: /docs/config/http.html (blocking & non
-
blocking)



Java AJP


Connector: /docs/config/ajp.html



APR (HTTP/AJP) Connector: /docs/apr.html



Define a non
-
SSL HTTP/1.1 Connector on port 8080



--
>



<
Connector port="
18080
" protocol="HTTP/1.1"


connectionTimeout="20000"


redirectPort="8443"




URIEncoding="UTF
-
8" />





<!
--

A "Connector" using the shared thread pool
--
>



<!
--



<Connector executor
="tomcatThreadPool"



port="
18080
" protocol="HTTP/1.1"


connectionTimeout="20000"


redirectPort="8443" />


If this particular port is occupied, you will need to make manual changes accordingly.


E.

Install Tomcat 6 a
s a Windows service. Admin privilege is needed here. For that purpose, Run As
Administrator the cmd.exe and execute the following:


E:
\
tomcat
\
bin>service install

Installing the service 'Tomcat6' ...

Using CATALINA_HOME:


"E:
\
tomcat"

Using CATALINA_BASE:


"E:
\
tomcat"

Using JAVA_HOME:



"C:
\
Program Files (x86)
\
Java
\
jdk1.6.0_20"

Using JVM:


"C:
\
Program Files (x86)
\
Java
\
jdk1.6.0_20
\
jre
\
bin
\
server
\
jvm.dll"

The service 'Tomcat6' has been installed.


If removing the Windows service, you would

do it like follows:


E:
\
tomcat
\
bin>service remove Tomcat6

The service 'Tomcat6' has been removed


You can now use the standard Windows Service Control Manager (from Control Panel
-
>
Administrative Tools
-
> Services). The newly installed service will show
as 'Apache Tomcat 6'.
The startup is manual and the service runs under the local system account. You should keep the
default settings, maybe only change the service startup type to automatic, if necessary.


F.

Verify that the installation has been successful.

For that purpose, start the service manually
from the Service Control Manager. Verify that the service startup was successful by checking
Installing nCode oneStop Servlet on Windows

3


messages in the Windows Event Log (from Control Panel
-
> Administrative Tools
-
> Event Viewer
-
> Windows Logs
-
> Syst
em).


G.

Use Internet Explorer, or any other Web Browser, on the local computer, in order to verify that
you can access nCode One Stop demo pages. If Tomcat was configured under a particular port
number (like 8080, or 18080), you can launch the following URL:

http://localhost:18080/nCodeOneStop/nCodeOneStopAutoSuggest.html
. Make sure that there
are no errors and that you get the expected page functionality. Of course, if


the loca
l machine
and network firewall rules allow, you can open the URL to the world and it should work without
problems, just replace 'localhost' with the name of the target machine, its network IP or DNS
name, if applicable. The Ajax calls that the demo pages w
ill perform target the relative path
(/nCodeOneStop/NCodeOneStopServlet), bypassing any problems with the same origin browser
policies. It would be possible to install the pages under IIS, however, the URL in the Java Script
would then need to be adjusted
to: var url =
"
http://<machine>:18080/nCodeOneStop/NCodeOneStopServlet
", where <machine> denotes
network machine name or its IP. Note that this would only work thanks to our implementation
of CORS with the nCode One Stop Java Servlet. If you
encounter problems here, send me all the
details and I will try to find a solution.


Finally, here is where the critical nCode One Stop files are located under Tomcat

(in case you make
future changes):




<drive>
\
tomcat
\
webapps
\
nCodeOneStop contains the Web
pages:
nCodeOneStopAutoSuggest.html and nCodeOneStopDemoPage.html.



<drive>
\
tomcat
\
webapps
\
nCodeOneStop
\
WEB
-
INF
\
classes
\
com
\
novamg
\
ncode
\
onestop
contains compiled nCode One Stop Java servlet Java classes,


*.class.



<drive>
\
tomcat
\
webapps
\
nCodeOneStop
\
WEB
-
IN
F
\
lib contains all required *.jar files.



E:
\
tomcat
\
webapps
\
nCodeOneStop
\
WEB
-
INF
\
classes contains log4j.properties file, which
contains log4j logging configuration.


I have executed this MOP on my Windows 7 virtual machine and it all worked out successfull
y.


Note
. While the above steps easily worked in my case, it is not absolutely clear whether the steps B and
C are necessary if not using Eclipse.