Results 1 to 11 of 11
  1. #1
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default JSCH as library does not response from html applet call

    Hello my Friends

    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.

    Please can any one help me ?
    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>

    Thank you In Advanced

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: JSCH as library does not response from html applet call

    does not give any error.
    That's strange. Do all the catch blocks have calls to the printStackTrace() method?
    Are you looking in the browser's java console for any messages?

    If the other jar files are in a different folder, how does the applet find that jar file?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default Re: JSCH as library does not response from html applet call

    Thank you for your answer

    No i didnt use the printStackTrace() method because i dont know it.
    Now i enable the java console and i notice this message "com.jcraft.jsch.JSchException: java.security.AccessControlException: access denied ("java.net.SocketPermission" "mydomain.com" "resolve")
    ".

    I create a different folder for the jsch-0.1.50.jar, named lib, because i found out that the Netbeans was created the same one in the projects' source folder.

    Any idea for the message above.

    The strange think is that when i run tha applet with Netbeans it runs, when i call it from the browser i have the problem


    Thank you again


    ki_ha1984

  4. #4
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default Re: JSCH as library does not response from html applet call

    oops sorry i forget to tell you that when i make the connection from the Netbeans it appears a popup window like in the next image, from the other side when i try to establish connection from the HTML code it does not appear, maybe it helps this.

    JSCH as library does not response from html applet call-untitled.png

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: JSCH as library does not response from html applet call

    com.jcraft.jsch.JSchException: java.security.AccessControlException: access denied ("java.net.SocketPermission" "mydomain.com" "resolve")
    The applet needs permission to access a website other than the one it was loaded from.
    There are several ways to give permission. Sign the jar file or make changes to the .java.policy file on the PC where the applet is being loaded.
    Granting permission is a big topic so you need to do some research on the internet to find out about it.

    I suspect that the IDE is taking care of the permissions.
    If you don't understand my response, don't ignore it, ask a question.

  6. #6
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default Re: JSCH as library does not response from html applet call

    This means that who every look this website, with the applet, it has to do some changes on his java policies ?
    Can you please send me any example or any tutor how to solve this problem ?

    Thank you

    ki_ha1984

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: JSCH as library does not response from html applet call

    Sorry, I don't have any good links to the sites. Try an internet search engine.
    Here are some I have:
    https://blogs.oracle.com/java-platfo...ments_for_rias
    http://docs.oracle.com/javase/7/docs.../manifest.html
    http://docs.oracle.com/javase/tutori...let/index.html

    A signed jar wouldn't require users to make any changes to their systems.
    Last edited by Norm; 04-12-2014 at 07:02 PM.
    If you don't understand my response, don't ignore it, ask a question.

  8. #8
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default Re: JSCH as library does not response from html applet call

    Thank you very much

    I found those links
    Signing JAR Files (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)
    Signing and Verifying JAR Files (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)
    How to sign JAR files - The CA Plex Wiki

    I will try to make signed the jar file, but the question which one ? my.jar file or the library jar file jsch-0.1.50.jar or both of them ?
    One more question, the signing will cause any problem to my code ?

    Thank you
    Ki_ha1984

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: JSCH as library does not response from html applet call

    Try it and see what happens. The signing should not change what you put into the jar file.
    If you don't understand my response, don't ignore it, ask a question.

  10. #10
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default Re: JSCH as library does not response from html applet call

    i tried to sign my jar file and worked for me thank you very much you are perfect Norm.

    I have those messages are they important

    CacheEntry[file:/C:/TESTAPPLET/my.jar]: updateAvailable=false,lastModified=Sat Apr 12 20:49:52 EEST 2014,length=23972
    Missing Application-Name manifest attribute for: file:/C:/TESTAPPLET/my.jar
    Missing Permissions manifest attribute in main jar: file:/C:/TESTAPPLET/my.jar
    CacheEntry[file:/C:/TESTAPPLET/lib/jsch-0.1.50.jar]: updateAvailable=true,lastModified=Mon Mar 31 23:40:50 EEST 2014,length=249282
    Missing Application-Name manifest attribute for: file:/C:/TESTAPPLET/lib/jsch-0.1.50.jar


    Thank you very much again

    ki_ha1984

  11. #11
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: JSCH as library does not response from html applet call

    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Excel to Html Conversion using apache poi library
    By agastheswar in forum New To Java
    Replies: 5
    Last Post: 05-09-2014, 11:28 AM
  2. how to call jsp from html
    By anchitanc in forum JavaServer Pages (JSP) and JSTL
    Replies: 23
    Last Post: 01-26-2012, 04:56 PM
  3. parsing out some data.. from an HTML response
    By AndyMan in forum New To Java
    Replies: 1
    Last Post: 11-29-2010, 02:00 AM
  4. call executable jar from html/jsp
    By Zahari in forum JavaServer Pages (JSP) and JSTL
    Replies: 6
    Last Post: 12-06-2007, 12:00 AM
  5. how to call a JAR FILE from HTML
    By leonard in forum Java Applets
    Replies: 1
    Last Post: 08-05-2007, 06:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •