JSCH As Library Does Not Response From HTML Applet Call
Apr 12, 2014
I work on SSH for creating a external tool to manage remote OS.
I find out the JSch library and i create the java GUI project as jar application, and worked for me very well. (i am working on Netbeans ).
I introduce the JSch library with Netbeans as follow. Right click on the Project-> Properties -> Libraries ->Compile ->Add JAR/Folder.
After that i try to transform the project to applet in order to work it form web server.
I made the transformation in all the code.
When i run the applet through the Netbeans it worked for me. When i build the project to create the jar file.
I create a folder with the my.jar file, index.html, a folder named (lib) which contains the jsch-0.1.50.jar file.
Then try to run the index.html, the GUI appear but cannot connect to the remote with the SSH, and does not give any error.
I think that the problem is that my.jar cannot communicate with the jsch-0.1.50.jar.
Why the project runs trough the Netbeans an does not run when i call it from the next html code.
index.html
Java Code:
<Html>
<Head>
<Title>Java Example</Title>
</Head>
<Body>
This is my page<br>
Below you see an applet<br>
<br>
<Applet Code="AppletUI.class" archive="my.jar" width=600 Height=700>
</Applet>
<Body>
</Body>
</Html> mh_sh_highlight_all('java');
View Replies
ADVERTISEMENT
Mar 6, 2015
i'm sending soap request but i'm getting html response it is leading to crash! how to parse html response?
View Replies
View Related
Apr 27, 2015
I get this error when I load a HTML page with WebEngine. The HTML is getting generated by an own (Java-)ServerSocket. How can I figure out where the problem is? I can load the HTML file successfully when loading the(same) generated HTML file from the local filesystem. Maybe the http headers causing these problems ? On the other hand I can load the page without problems in Firefox. How to get more information ?
View Replies
View Related
Oct 16, 2014
I have an arraylist in my servlet which i need to pass to jsp as a response for a javascript call. This is an arraylist of DTOs. There are 24 DTO objects in the list. The DTO has an int variable and a HashMap. And i need to pass this into the javascript code in my jsp page. Do i use json? Do i send the entire list as a json object or should i iterate through the arraylist (from servlet) and serialize all the DTOs and pass that to the jsp?
View Replies
View Related
Mar 17, 2012
i am getting the following errors.
Exception in thread "main" java.lang.NullPointerException
at java.io.Reader.<init>(Unknown Source)
at java.io.InputStreamReader.<init>(Unknown Source)
at ToHtml.printStyles(ToHtml.java:215)
at ToHtml.printInlineStyle(ToHtml.java:199)
[code]...
View Replies
View Related
Nov 22, 2014
I am trying to pass parameters from he following HTML file to an applet. the applet is not initializing and the iam getting the following error on the console. I also have both the html file and and the java applet under the same source file in eclipse.
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.parseInt(Integer.java:615)
at applet.DisplayMessage.init(DisplayMessage.java:16)
at sun.applet.AppletPanel.run(AppletPanel.java:434)
at java.lang.Thread.run(Thread.java:745)
Here is the html file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
[Code] ....
View Replies
View Related
May 8, 2013
When I embed java applet in html the "ClassNotFoundException" message appear to me, how to overcome this ....
View Replies
View Related
Aug 7, 2014
I compiled the applet, then put the applet in an HTML file using notepad and saved the html file in the right place for it to run correctly. The HTML file runs smoothly, but then it only shows the scrollbar part of my applet, and not the images or any text...
Why is This?????
Java Code:
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
import javax.swing.ImageIcon;
public class Temperature_Convert extends Applet
implements AdjustmentListener {
private Image temp;
private Scrollbar bar;
private int old, newtemp = 0;
[code]....
View Replies
View Related
Sep 7, 2014
I want to set an html text on al label, but also call a method.
I tried:
Java Code:
scoreMens.setText("<html>joejoe<BR>jaja<BR</html>" + naamSpeler.laatKaartenZien()); mh_sh_highlight_all('java');
But the naamSpeler.laatKaartenZien(), which returns a string, doesn't show on the label. Is there a way to call a method and use a html text on a label?
The name of the thread should be "call method in html text on label"
View Replies
View Related
Feb 27, 2015
I have created a simple applet application that is embedded in a HTML. When I did compiled it, I received an error of ClassNotFoundException. I'm using Jdeveloper11gR1. Please see screenshot.
This is my error :
java.lang.ClassNotFoundException: cams.gsis.applet.CAMSApplet
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
[Code] ....
And this is my Error on java console.
basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@c5dde6
security: Expected Main URL: http://localhost:7101/CAMSv6-CAMSv6-context-root/cams/gsis/applet/CAMSApplet.class
network: Cache entry not found [url: http://localhost:7101/CAMSv6-CAMSv6-context-root/cams/gsis/applet/CAMSApplet.class, version: null]
[Code] .....
View Replies
View Related
Jun 22, 2014
I have an applet which I want to embed into HTML. In applet viewer in Eclipse IDE the view is this(see pict01), and when I access my index.php on local server I get this view(see pict02). I don't know what I am doing wrong. I checked it with Firefox, IE and chrome. No changes. Here is source code:
import java.util.*;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.applet.*;
import java.net.URL;
public class WCURL extends JApplet {
//static final int WIDTH = 8;
//static final int HEIGHT = 12;
[Code] ......
I have these files in my local servers folder where I am trying to access it from(see pict03).
View Replies
View Related
Jan 18, 2014
I want to know can we put the data of html file example
<html>
<body><applet code="classname" width="100" height="100">
</applet>
</body>
</html>
into my Applet's java file it can be done i have read it somewhere and have also implemented it ..... but now unable to memorize it
View Replies
View Related
Feb 18, 2014
I use the jsch libraries to create a SHH connection to a remote linux machine. In the next code, given from a tutorial of the JSCH creator, you can see it is implemented shell communication, it is a direct communication from a cmd window. You enter a command from the cmd window and you get aback the results in the cmd window.
Java Code:
String user = "username";
String host = "hostname";
ession session=jsch.getSession(user, host, 22);
String passwd = JOptionPane.showInputDialog("Enter password");
session.setPassword(passwd);
Channel channel=session.openChannel("shell");
session.connect();
channel.setInputStream(System.in);
channel.setOutputStream(System.out); mh_sh_highlight_all('java');
How i can redirect the next two lines to jTextField1 and jTextField2. To give an example i want to sen the command from the jTextField1 and to get the results from the jTextField2.
Java Code:
channel.setInputStream(System.in);
channel.setOutputStream(System.out); mh_sh_highlight_all('java');
View Replies
View Related
Jun 10, 2014
I would like to ask how i can create a bidirectional folder copy system with SFTP JSch is there any example. Like i see the code can only transfer file, I need to transfer a folder with many files from my pc to a server and the opposite.
View Replies
View Related
Feb 19, 2015
Inspite of not returning anything, what is the purpose of response object in servlet? I have typically used or heard of only response.sendRedirect()
View Replies
View Related
Jul 29, 2014
I am trying to print the response of servlet as pdf. Below is my codeI am able to generate the response but not quite sure how should I write it to a pdf.
package com.Hardik;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.ConnectException;
import javax.net.ssl.HttpsURLConnection;
[Code] .....
View Replies
View Related
Oct 5, 2014
@RequestMapping(value = { "/mapping" }, method = RequestMethod.GET)
@ResponseBody
public Map<A, List<B>> getAsByB(HttpServletRequest httpRequest) {
return map;
}
when i try to get it by url i get an error. how can i send a response of a map as a json ?
View Replies
View Related
Jul 23, 2014
I have a requirement where a form is present with first name, last name, file upload etc. File upload is done through ajax call and then the form is submitted to a servlet. I want to know whether the file has been uploaded or not in the servlet which is called after i click on the form submit button. So is there any way i can read the response of the ajax call in the servlet ?
here is the ajax call below
$.ajaxFileUpload
(
{
url:_action,
[Code]...
View Replies
View Related
Jul 6, 2014
I have a EAR enterprise project with EJB and Web module.EJB module has a SongTokenImpl stateless session bean with @Stateless and @Webservice annotation.Web module has SongServlet.java and success jsp.
SongServlet has dependency injection to SongTokenImpl.
@EJB
TicketMaster songMaster;
@EJB
ShoppingCart shoppingCart;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String songName = request.getParameter("songname");
Token token = tokentMaster.bookToken(new Song(songName));
System.out.println("we got song token for song "+token.getSongName());
[code]....
we got song token for song xyzInstead i see below error.SongServlet threw exception: java.lang.IllegalStateException: Cannot create a session after the response has been committed/
View Replies
View Related
Feb 18, 2015
I have a SOAP Client with wsdl to send a query to a SOAP Server. Along with the SOAP response I am supposed to attach a generated csv file (Not required to open and read - just attach).
SOAP Handler has been implemented at server.
Since it is client code I am not supposed to paste the exact contents online.
I can create new SOAPMessage and use AttachmentPart to attach the file but I am stumped regarding where to set it as response. We have used only javax.xml and apache.cxf.
View Replies
View Related
Aug 8, 2014
I am trying to make a method that takes in a cmd command (nslookup, systeminfo, etc), and outputs the response to a text file. I have tried a dozen different ways with no success. below is my most current failure. It succeeds when i run it, but nothing shows up in the text file.
public static void runSystemCommand(String command) {
command = "ping 192.168.1.3";
try{
Process proc = Runtime.getRuntime().exec(command);
InputStream in = new BufferedInputStream(proc.getInputStream());
OutputStream out = new BufferedOutputStream(new FileOutputStream("C:NetPanelDataping.txt"));
[Code] ....
View Replies
View Related
Mar 14, 2015
I'm making a "very" basic blackjack game, and I'm stuck on how to get a user response to hit and stick game play.
import java.util.Random;
import java.util.Scanner;
class blackjack {
public static void main ( String[] args ) {
Random r = new Random();
Scanner keyboard = new Scanner(System.in);
String money;
String name;
[Code]...
I know people will want me to tidy it up, or do it "their" way, but honestly I just need method of getting the user to press h or s and have the program continue under it's own steam.
View Replies
View Related
Jan 22, 2014
i am using eclipse kepler and tomcat 7 with the below code to get a response from the browser. i get no errors on my code and i organize my imports but when i run the code i get an http 404 error. i restart the server and it goes into the whole motion telling me that "Tomcat v7.0 Server at localhost started and is synchonized" i refresh it and i still get the error.
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
[code]....
View Replies
View Related
Nov 27, 2014
I want to print RAW Request Response XML to console. I have created the stubs using wsdl2java axis2. wsdl2java has created 2 java files, one for stub and one for callbackhandler.
I am trying with below method but getting null value for
operationContext.getMessageContext("Out") / operationContext.getMessageContext("In");.
public void SOAPLogHandler(Stub stub){
ServiceContext serviceConxt = stub._getServiceClient().getServiceContext();
//**** Enable the Cache to hold the last operation
OperationContext OperationContext = new OperationContext();
boolean cacheLastOperationContext = true;
OperationContext.setComplete(true); // Enable the Cache value
serviceConxt.setCachingOperationContext(cacheLastOperationContext);
serviceConxt.setLastOperationContext(OperationContext);
[code]....
View Replies
View Related
Nov 27, 2014
I am calling a SOAP based webservice using JAX-WS and a client jar. I want to get a request and response somehow and save it for audit purposes. How I can do this?
When I google it, only Handlers come up, but, as far as I understand, it is not applicable on client side.
View Replies
View Related
Jun 15, 2015
I have been using JavaFX for some time now and have encountered many performance issues, mainly with the initial display of GUI elements. For example, a simple stage with a table view (with about 10 columns) and chart takes about 5 seconds to display. A color picker will take about 3 seconds from the time I click the control to when it displays the pallet. This only happens when the controls are first displayed. This can't be right. I have searched and none seems to have a similar problem so I thought I would ask here just to make sure. Here is a sample Hello world that shows the problem with the color picker (takes ~ 3 seconds to show pallet when clicked).
public class HelloWorld extends Application
{
@Override
public void start(Stage primaryStage) {
StackPane root = new StackPane();
ColorPicker cp = new ColorPicker();
root.getChildren().add(cp);
[Code] .....
View Replies
View Related