- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Java Applet from VMS Web Server
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-20-2006 07:16 AM
тАО12-20-2006 07:16 AM
Re: Java Applet from VMS Web Server
I am at home now. So I copy the sources from my previous posts and try to compile Test.java. No errors.
Check the source one more time. It seems that you lost the "public static void" of the main method.
Another possible problem (I dont know how is on Windows) can be that you named the source test.java and not Test.java. In Java the source name and class name must be same. So (on a *NIX system not on VMS) this will generate an error like this:
"class Test is public, should be declared in a file named Test.java"
[ The only other thing I can see that I did differently from you is that I had my html files on the W2K box and was accessing them with either a "file" url or a double-click.]
That can be the problem. Now I am unable to test (no VMS, no Windows) but if you remember yours words:
[Excellent! So if I understand you correctly, Any (socket) connect from the applet has to go to where the original html page was downloaded from *or* where the applet is downloaded from (if different).]
[What do I enter after it says "VM Started"]
Enter some start characters in the text box and if all is OK you will see the names in the select box.
If not, nothing will hapen :(
You can enlarge the top frame and you will see the applet icon. If you right click on this icon you can open the java console. All errors will be displayed in this console.
The log file seem to be from the appletviewer connection (User-Agent: Java(tm) 2 SDK, Standard Edition v1.6.0 Java/1.6.0) and not IE. Check the logs if you have a connection from IE.
It will be quite hard to debug in the appletviewer because it probably dont know anything abbout javascript but I am not shure because I do not use appletviewer.
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-20-2006 01:37 PM
тАО12-20-2006 01:37 PM
Re: Java Applet from VMS Web Server
I certainly don't expect you to look at this while you're on holidays and I won't take it personally if I don't hear from you for a while.
As for Test.java, yes, it was my fat fingers that somehow stuffed things up. (This probably doesn't fill you with confidence but I promise not to do it again :-) Anyway, all is well, and test.java talks to my server beautifully and quite quickly too.
Now for the HTML :-( I balked at the idea of moving the html to the VMS system (but stay with me 'cos I think we've got *an* answer without it)
Internet Explorer didn't know what to do with your Firefox declaration but knew to go to the codebase for both of your IE declarations. Here is the DCL log from the server: -
$ open/read/write net sys$net
$read_it:
$ read net httpcmd /time=5/error=end
$ method = f$element (0 , " " , httpcmd)
$ path = f$element (1 , " " , httpcmd)
$ show sym/all
HTTPCMD = "GET /emp.jar HTTP/1.1..accept-encoding: pack200-gzip, gzip..User-Agent: Mozilla/4.0 (Windows 2000 5.0) Java/1.6.0..Host
: 1.2.3.6..Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2..Connection: keep-alive...."
METHOD = "GET"
PATH = "/emp.jar"
$ if "GET".eqs.method
$ then
$ filename = "t3$applets:" + f$element (1 , "/" , path)
$ if f$search(filename).nes.""
$ then
$ type = "application/octet-stream"
$ if f$parse(filename,,,"TYPE").eqs.".HTML" then type="text/html"
$ write net f$fao("HTTP/1.0 200 OK!/")
$ write net f$fao("Content-Type: application/octet-stream!/")
$ len = (f$file(filename , "EOF") - 1) * 512 + f$file(filename,"FFB")
$ write net f$fao("Content-Length: 3115!/!/")
$ copy t3$applets:emp.jar net
$ goto read_it
$read_it:
$ read net httpcmd /time=5/error=end
So far so good. The problem is I get ClassNotFoundError: EmpApplet.class :-(
Here's the complete error:
java.lang.ClassNotFoundException: EmpApplet.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
And here's the Jar file manifest:
Directory of C:\Java\Bojan\Applets
17/12/2006 08:27p 3,115 emp.jar
1 File(s) 3,115 bytes
C:\Java\Bojan\Applets>jar -tf emp.jar
META-INF/
META-INF/MANIFEST.MF
EmpApplet.class
EmpClient.class
EmpClient$Message.class
I don't understand it! *All* 3115 bytes have been sent but WindowsIE hasn't seen the Class name "EmpApplet".
Is this a Java 1.6 version issue?
Should I deinstall and reinstall 1.5 (or something>)
Can I use the -target switch on JAVAC?
Would -debug help?
How about JAR -e EmpApplet?
Or should I just copy all the html and jar and class files to the one VMS directory, do what you told me and stop wasting your time :-)
Cheers Richard Maher
PS. Once again, if I use the AppletViewer on Applet.html (in this case with the
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-21-2006 01:02 AM
тАО12-21-2006 01:02 AM
Re: Java Applet from VMS Web Server
From the log it seems that the file was transfered.
Now the problem is why you get ClassNotFoundError: EmpApplet.class?
Maybe the mickey-mouse applet uploader (I like this definition :) does not work ok.
But you say that it works with the appletviewer.
Can you check once more if the jar is transfered OK? Point your browser to http://1.2.3.4:4444/emp.jar (or whatever is the address of the applet uploader) and save the file. Now go to the command prompt and compare the file with the original emp.jar (COMP original.jar downloaded.jar).
If you have java on VMS you can try to extract the files from the jar with jar -xf emp.jar.
On my laptop I have 1.5.0 sun java and IE 6.0.2900.2180.xpsp2_gdr.050301-1519 (what a number for a version). For testing purposes (test on other older browsers) the java classes were compiled with java 1.4.1_01.
If you have any type of web server instaled on VMS, please try with the server.
Another thing you can try:
Put all the html and jar files in a directory on yours PC, modify the contents of the html files (probably only applet.html) to get the applet from the local disk. The error must be something like "Security exception" but no ClassNotFoundError.
Abbout Java 1.6 and IE7.
No experience with them. I am not a fun of last versions so I will first try to downgrade (do not forget to recompile the classes).
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2006 05:20 PM
тАО12-22-2006 05:20 PM
Re: Java Applet from VMS Web Server
I honestly don't know why you persist with me 'cos I've gone and done it again :-( The problem seems to stem from the fact that I put a loop around the "read" in your Mickey Mouse WebServer even though I knew full well that it specified "http 1.0". I did this 'cos I was debugging and wanted to make sure thet nothing else was coming down the line.
Unfortunately, Internet Explorer seems to look for the Socket Closure status to indicate EOF even though I'd told it 3115 bytes were coming and it had received 3115 bytes :-(
It was your suggestion to copy the JAR back and compare it with the original that gave the game away. It just sat there saying it was copying indefinitely until I took the "goto read" out of the server. (BTW they finally Compared as equal)
What you may find interesting is that IE asks for the JAR file *3* times (Looks like once per class) even though all classes are in the one file and the manifest says so. Any ideas? IE only? Http 1.*0* only? Missing a switch or setting somewhere? (I'm using the
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-24-2006 01:25 AM
тАО12-24-2006 01:25 AM
Re: Java Applet from VMS Web Server
I am glad to hear that the example finally works for you.
How many times it asks for the jar file probably depends on the class loader implementation which does not do any caching of the downloaded jar. (The ClassLoader in java is similar to the image activator in other operating systems. It is java class which is responsable to find and load code in the virtual machine. It is possible to write a new class loader extending the original one, but I think that this is not possible in applets for security reasons).
Maybe the Mickey Mouse WebServer should be modified to pass some more header entries in the response. I mean the "Date" and "Expires" header. Try to modify the server:
$ write net $fao("Content-Type: ''type'!/")
$! this is the new line:
$ write net $fao("Expires: Tue, 01 Jan 2008 00:00:00 GMT!/")
If this helps you can try to write code to transform the VMS date in the HTTP-date format (see the HTTP rfc, the link is in one of my previous posts).
[PS. I think having to hit the down button to see the list is rubbish]
I said many times that this is only an example. I used the standard html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2007 01:15 AM
тАО02-27-2007 01:15 AM
Re: Java Applet from VMS Web Server
You are an absolute bloody marvel mate! (Appologies for taking so long to reply. I├в ve been doing this in my spare time, and we had Christmas and school holidays and I├в m incompetent with Java and have to re-read much and yadda, yadda, yadda. . .) Anyway, the good news is that I now know enough about Java Applets, html and Javascript to know that *everything* you gave me in your example(s) was completely relevant and useful! Maybe I├в m the only one that hadn├в t heard of you before this thread but I reakon you├в re a legend! (It takes time to offer the advice and *working* examples that you did with the full knowledge that you├в d get little in return. You put me on the right track (and the web is full of great examples, documentation and newsgroups for anyone persuing a similar path) and for that you have my sincere gratitude!)
Ok, enough BrokeBack Mountain :-) let me tell you where I├в m up to. (Before I do, and talking about movies, I saw Rocky tonight and have to say it├в s strictly one for the fans, but you could draw an anology between his ├в How many hits can you take and still keep moving forward├в and the life of VMS) Allora, attached is my first attempt at putting my new found knowledge into action. This is a simple web page example that talks to my Tier3 T3$EXAMPLES:DEMO_UARS.COB VMS queue lookup routines.
1) Example1.html
The Form accepts a Job Entry number (or zeros for wild) and returns all matching que entries that the user is authorized to see.
2) CornuCopiae.java
Main Applet class coordinates Authorization and Socket classes
3) Tier3Logon.java
Pops up a dialog box for username/password
4) Tier3Welcome.java
If the user ticked yes for the welcome message when logging on then another dialog box is displayed telling them last login times and the number of failures since last successful login.
5) Tier3Socket.class
All the network/socket stuff
6) AccessDenied.html
What to display if Authorization fails.
Please have a look and tell me what you think or if you have any advice of things like ├в serializable├в etc. I will tighten up the public/private stuff at a later stage; this is just a ├в how to├в .
I didn├в t use Frames as I deliberately wanted to make it as easy as possible for those dirty stinking peasants that will read this and can├в t think for themselves without being spoon-fed and tucked up at night. For example 2 (hopefully this long-weekend) I├в m gonna implement Frames (a la Bojan) in an attempt to get a hot abort key in one frame that will send an OOB down the global applet├в s socket to interrupt the server performing work under the instruction of an onblah() event in another frame. Make sense? Will it work? I reakon the idea├в s got legs!
BTW. Where is your much vaunted (promised IIRC :-) example of a thread, and accompanying socket, surviving a page swap?
Interested in hearing your thoughts! (AJAX is such crap) Webservers are such round holes and here├в s everyone holding square pegs :-(
Cheers (and thanks again) Richard Maher
PS. Example only works with IE (at the moment and only tested with IE6) Windows2000 and Java1.6
├в Tier3├в is a registered trademark of Tier3 Software Ltd
├в CornuCopiae├в is a trademark of Richard Maher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2007 12:13 AM
тАО02-28-2007 12:13 AM
Re: Java Applet from VMS Web Server
A couple of people have asked to see the VMS side of the previous example so I have attached the 6 COBOL User Action Routines that constitute the entirety of the server code required to satisfy the client's requests for job entry information.
All of the User Authentication, Multi-Threading, Network Comms, and Server load balancing, are all done for you transparently by Tier3. All you have to know is VMS and a 3GL!
Similarly, on the client side, all you have to know is HTML and Javascript. I have included the JAVA proper because I'd like Bojan's (and other's) opinion and so you can see what the Applet is doing, but you by no means have to modify this code for the next "N" Tier3 applications as they'll all do the same thing. The code is completely reusable or recyclable. If you think "Oh Dickie, you should've used Swing instead of AWT" or "I don't like where you're positioning your dialog boxes" or "where's my Integer() bigendian swap method?" then go ahead and bloody change it. If, on the other hand, you think JAVA is too hard/different then just stick with the html/Javascript.
In other words: - "Here is the water. You need water to drink. If you don't drink you will die. The reason that you, your company, and VMS in general are currently suffering from complete renal failure is because you are too pig ignorant to drink!".
I swear to God that I just don't know how I can make it any easier!
Cheers Richard Maher
PS. Nah, tell ya what; you stick to the Waste of Substantial Investment in Technology. Everyone's talking about SOAP, so just keep your head down and they'll be wheeling VMS out next year anyway :-(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2007 09:34 PM
тАО03-01-2007 09:34 PM
Re: Java Applet from VMS Web Server
Thanks, for the nice words in your previous post.
Glad to see that you make some progress.
I take a quick look to your code and seems ok. The only thing is that I will move as much as possible of code from JavaScript to JAVA, but this depends on personal taste.
Abbout AJAX. What you are doing is a kind of AJAX! The difference is that you use your private communication object and not the XMLHttpRequest (which is used in AJAX communication and is a sort of a very simple browser) and you transfer data as a stream and not as XML.
Abbout the surviving communication I spent some time and there is the (very very simple and not fully tested;) example. It is a substitute for the previous EmpApplet, all other files are the same. You will notice that the only thing I replaced is the "static" attribute of the communication object. Only the first time you run the applet the communication object is created. Also you dont need any special threads.
Talking about SOAP. It is not so hard to implement a SOAP server which will call COBOL (or any other VMS 3GL language) and pass the data in a VMS like maner (I did this some months ago).
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2007 05:30 AM
тАО04-04-2007 05:30 AM
Re: Java Applet from VMS Web Server
Talking about SOAP. It is not so hard to implement a SOAP server which will call COBOL (or any other VMS 3GL language) and pass the data in a VMS like maner (I did this some months ago).
Can u attach some examples of that...
Thanks in advance..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2007 10:03 AM
тАО04-04-2007 10:03 AM
Re: Java Applet from VMS Web Server
> Can u attach some examples of that...
I hope he can't; or at least Won't in *this* thread. If you'd like to start up your own thread "SOAP COBOL examples please" or (WSIT "Waste of Substantial Investment In Technology" and what it means for me, then please do.
Hi Bojan
> Abbout AJAX. . .what you're doing is kind of ajax.
Running around flapping one's arms is "kind of flying" I suppose :-) One's a context-rich, pre-authorized, full-duplex, conversational-pipe and the other doesn't even look like an Apple at all!
What does interest me about XMLHttpRequest is how does the underlying socket code triggers the onreadystatechange event in the browser? Or to ask the question another way, If I have an applet with a seperate thread running around, is there an API that would let me craft a browser recognizable event and then call a fireEvent() method to send it from Java land to the JavaScript world in the Browser?
Do you have a link to any web sites that are using the Applet window to interact with the user and have that GUI co-exist with it's enclosing web-page UI?
Regards Richard Maher
PS. If I call XMLHttpRequest.abort() doesn't it just cancel the request at the client end and leave the server running away maniacally for no purpose?
PS. I Think I'll start another thread also: - Examples of XMLHttpRequest that allow the client to start receiving the result set (and enriching/adding value to each row) and to start showing the user the "growing" select list on screen, as and when the rows begin to emerge from the server. That is, not have to wait for the manifestation of some Uber-Message.
And "web-authorization and the limitations of a stateless, quasi-middleware protocol pile-of-pooh like HTTP" is definitely worth another thread! Cookies, Session IDs, Username/Password caching/ vilnerabilities - All topics worthy of a guernsey in their own right; just not here eh?
- « Previous
- Next »