In my development, i am trying to execute a java executable file(jar) on client side. that jar file contains GUI mode or AWT controls application. i place a jar into PS home -> class directory. while i am calling that API class from the peoplecode , it throws an error message like
" Java Exception: java.awt.HeadlessException: during construction of com.guiffy.inside.GuiffyPanel. (2,768) TST_REC.OK_BTN.FieldChange PCPC:79 Statement:1
The constructor for the given class threw the noted Java exception. "
any one tell me a way to execute a java executable file on client side or on client browser.?
If I understand you correctly you do not want the java to be executed on the application server but by the browser/client?
To start with the main question, is the java code designed to run in a browser (applet)
call the jar file/applet from an html area op a page
Actually, i need to compare two files using third party tool called Guiffy. They provide Guiffy.exe as well as Guiffy.jar. In Guiffy.jar class files contains awt controls and swing controls(JPanel,JFrame classes) to generate the GUI report. While i try to invoke their classes using java, it work fine and get the results. In other case, i placed jar file in %PSHOME%/class directory and run it on browser , i get the error message which i showed before question.
You can't expect a GUI running on the application server via PeopleCode to be displayed on the client with this particular strategy. Try having it save the data directly to disk without displaying and then do something with that output. I think you need to read the instructions for your tool more. The Guiffy webpage makes it sound like you can do this with that tool.
Command Line Interfaces:
Guiffy includes several GUI and non-GUI command line interfaces for automation and integration with your environment. For further information, see the Command Line Interfaces in Guiffy's Help.
-ah -autoh fn Automatically Save the Difference as HTML and Exit
For example: -ahC:\build\w3\About.html automatically saves the difference as HTML to the "C:\build\w3\About.html" file set
Unfortunately, you didn't provide your requirements so we can only guess on a solution.
Sorry Mr.RCC i forget to give you a clear information about my requirement,
My requirement is, i have to compare two diffrent files using Guiffy compare tool and then display the compared result on client side in form of GUI mode within the browser itself. Guiffy GUI mode results displays the output in vertically. so we can easily see the difference between the two files. Using Guiffy.jar, its possible do it compare in java. If i am integrate with peoplecode it shows an error message while loading into browser. error message is,
Where are the files your trying to compare? What's wrong with the html file it creates, have you looked at that yet? Start simple just getting your compare to run/work before trying to get fancy and display it to the user.
The guiffy.inside package provides an API for building Guiffy inside Java applications --- or applets(trusted) --- or web application servlets.
This may allow you to build your own applet from the guiffy API to accomplish what you want, but again, maybe you should be reading the guiffy documentation more to figure out how to accomplish what you want. I don't think I can help you further.
What I am about to say may be common knowledge, so please no offense if this seems too simple minded. I just want to make sure everyone is clear on a few facts:
2. Any Java that runs in PeopleCode (jar files, class files) is run on the app server and has absolutely no user interface. It can't. It runs "headless." If Java run in PeopleCode attempts to present a user interface, it will throw the HeadlessException you saw earlier.
This is why RCC and Hakan suggested using an applet. An applet's Java, however, doesn't run on the App server. It runs on the client. PeopleCode associated with an applet would not call GetJavaClass or CreateJavaObject. Those two functions relate to Java running in the app server. An applet does not run in the app server, it runs on the client.
When using an applet, a problem that may arise is gaining access to the files you want to compare. The files exist on the app server, which should be separate from the web server. An applet (untrusted) can only compare files that are accessible from the web server. App server files are not accessible through the web server. A trusted applet can access files on other web servers or on the client PC. None of these are the case with app server files. They are protected by the host and should not be accessible through a web server. Through the use of iScripts, however, you can write the contents of an app server file to a browser, thereby making the file accessible through a web server.
In regards to the ClassNotFound exception, that is thrown if your app server's class path is missing a file (jar or class) file. If the file exists, then the problem may be that you need to restart your app server to load the jar file into the classpath.
But now i am facing another issue. I pasted my sample code below.
alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason.">
<param name='firstFilePath' value='c:/test.sql'>
<param name='secondFilePath' value='c:/test1.sql'>
Your browser is completely ignoring the <APPLET>
from the above code, i have placed my class file in the FTP path. So, if i have used the ftp path it works fine. But my requirement is, java class files need to be place in the webserver directory. then i have to include the webserver directory URL instead of FTP url. Is there any way to find out the webserver URL(webserver directory path) in which the webserver used at runtime.