Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6229841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:38:33+00:00 2026-05-24T09:38:33+00:00

I’m doing a bit of testing with the JTwain Library. I need to attach

  • 0

I’m doing a bit of testing with the JTwain Library. I need to attach scanning functionality to a Django App. I’ve got a bit of code that will run locally but I can’t make it work in an applet.

I’m back, trying to get the demo applet to run. I’ve created an eclipse ‘runable jar’ (I’ve had to add a dummy Main to one of the classes). And I’m getting the following output from the plugin console when I load the page in a browser –

    java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.AspriseJTwain)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkLink(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at com.asprise.util.jtwain.SourceManager.init(SourceManager.java:222)
    at com.asprise.util.jtwain.SourceManager.<init>(SourceManager.java:36)
    at com.asprise.util.jtwain.SourceManager.instance(SourceManager.java:28)
    at JTwainApplet.scan(JTwainApplet.java:39)
    at JTwainApplet.init(JTwainApplet.java:69)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
java.lang.UnsatisfiedLinkError: com.asprise.util.jtwain.lowlevel.Control.performAction(ILjava/lang/Object;)Z
    at com.asprise.util.jtwain.lowlevel.Control.performAction(Native Method)
    at com.asprise.util.jtwain.lowlevel.Control.unloadSourceManager(Control.java:93)
    at com.asprise.util.jtwain.SourceManager.closeSourceManager(SourceManager.java:120)
    at JTwainApplet.scan(JTwainApplet.java:57)
    at JTwainApplet.init(JTwainApplet.java:69)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Scan

Below is the structure of the Jar I’ve created.

C:\PythonProjects\CacheProject\media\java>jar tf demo.jar
META-INF/MANIFEST.MF
JTwainApplet.class
ImageDisplayer$1.class
ImageDisplayer.class
META-INF/
META-INF/ASPRISE.DSA
com/
com/asprise/
com/asprise/util/
com/asprise/util/jtwain/
com/asprise/util/jtwain/ImageGenerator.class
com/asprise/util/jtwain/InvalidStateException.class
com/asprise/util/jtwain/JTwainConstants.class
com/asprise/util/jtwain/JTwainException.class
com/asprise/util/jtwain/OperationException.class
com/asprise/util/jtwain/Source.class
com/asprise/util/jtwain/SourceManager.class
com/asprise/util/jtwain/lowlevel/
com/asprise/util/jtwain/lowlevel/Capability.class
com/asprise/util/jtwain/lowlevel/Control.class
com/asprise/util/jtwain/lowlevel/DataType.class
com/asprise/util/jtwain/lowlevel/DataTypeIdentity.class
com/asprise/util/jtwain/lowlevel/DataTypeImageInfo.class
com/asprise/util/jtwain/lowlevel/DataTypeImageLayout.class
com/asprise/util/jtwain/lowlevel/DataTypeVersion.class
com/asprise/util/jtwain/lowlevel/ItemType.class
com/asprise/util/jtwain/lowlevel/ItemTypeFix32.class
com/asprise/util/jtwain/lowlevel/ItemTypeFrame.class
com/asprise/util/jtwain/lowlevel/ItemTypeInteger.class
com/asprise/util/jtwain/lowlevel/ItemTypeString.class
com/asprise/util/jtwain/lowlevel/OperationResult.class
com/asprise/util/jtwain/lowlevel/ValueContainer.class
com/asprise/util/jtwain/lowlevel/ValueContainerArray.class
com/asprise/util/jtwain/lowlevel/ValueContainerEnumeration.class
com/asprise/util/jtwain/lowlevel/ValueContainerOneValue.class
com/asprise/util/jtwain/lowlevel/ValueContainerRange.class
com/asprise/util/jtwain/web/
com/asprise/util/jtwain/web/FileUploader.class
com/asprise/util/jtwain/web/ImageDisplayPanel.class
com/asprise/util/jtwain/web/UploadApplet.class
com/asprise/util/jtwain/web/UploadApplet_buttonCheckJTwain_actionAdapter.class
com/asprise/util/jtwain/web/UploadApplet_buttonInstallJVM_actionAdapter.class
com/asprise/util/jtwain/web/UploadApplet_buttonScan_actionAdapter.class
com/asprise/util/jtwain/web/UploadApplet_buttonUpload_actionAdapter.class
com/asprise/util/jtwain/web/UploadApplet_labelURL_mouseAdapter.class
com/asprise/util/jtwain/web/UploadApplet_useProxy_actionAdapter.class

And here’s the Code for the JTwainApplet

    import java.applet.Applet;
import java.awt.HeadlessException;
import java.awt.Image;

import com.asprise.util.jtwain.Source;
import com.asprise.util.jtwain.SourceManager;

/*
 * $Id$
 * 
 */

/**
 * @author  JACK    (Jan 19, 2004)
 */
public class JTwainApplet extends Applet {

    /**
     * @throws java.awt.HeadlessException
     */
    public JTwainApplet() throws HeadlessException {
        super();
        // TODO Auto-generated constructor stub
    }

    public static void main(String[] args) {
    }
    /* (non-Javadoc)
     * @see java.applet.Applet#destroy()
     */
    public void destroy() {
        // TODO Auto-generated method stub
        super.destroy();
    }

    public void scan() {
            try {
                // SourceManager.setLibraryPath("E:\\Twain\\Asprise\\JT\\Debug\\JT.dll");
                Source source = SourceManager.instance().getDefaultSource();

                if(source == null) {
                    System.err.println("There is no (default) source on the system!");
                    return;
                }

                source.open();

                Image image = source.acquireImage();

                new ImageDisplayer("DemoSimple", image);

                source.close();

            }catch(Exception e) {
                e.printStackTrace();
            }finally{
                SourceManager.closeSourceManager();
            }
    }

    /* (non-Javadoc)
     * @see java.applet.Applet#init()
     */
    public void init() {
        super.init();

        System.out.println("Init.");

        scan();

        System.out.println("Scan");
    }

    /* (non-Javadoc)
     * @see java.applet.Applet#start()
     */
    public void start() {
        // TODO Auto-generated method stub
        super.start();
    }

    /* (non-Javadoc)
     * @see java.applet.Applet#stop()
     */
    public void stop() {
        // TODO Auto-generated method stub
        super.stop();
    }

}

Lastly my jnpl and html source

    <?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
    <information>
        <title>Cache Scanning</title>
        <vendor>Altcom</vendor>
    </information>
    <resources>
        <!-- Application Resources -->
        <j2se version="1.6+"
              href="http://java.sun.com/products/autodl/j2se" />
        <jar href="http://127.0.0.1:18123/media/java/demo.jar" main="true" />
    </resources>
    <applet-desc 
         name="JTwain Applet Demo"
         main-class="JTwainApplet"
         width="500"
         height="200">
     </applet-desc>
     <update check="background"/>
</jnlp> 



   **javascript** - 
 <script src="http://java.com/js/deployJava.js"></script>    
    <script> 
        var attributes = { code: "http://127.0.0.1:18123/media/java/demo.jar",  width:500, height:200} ; 
        var parameters = {jnlp_href: "http://127.0.0.1:18123/media/java/demo.jnlp"} ; 
        deployJava.runApplet(attributes, parameters, '1.6'); 
    </script>

Any suggestions would be greatfully recieved. This is driving me nuts.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:38:33+00:00Added an answer on May 24, 2026 at 9:38 am

    OK, this is how I got it working. I stopped using the ‘create runnable jar’ option in eclipse and just used the ‘create jar’ option. I then referenced the other jars (JTwain etc), using the manifest (rather than having eclipse try to include them in my jar).

    MANIFEST.MF

    Manifest-Version: 1.0
    Class-Path: JTwain.jar plugin.jar AspriseJavaPDF.jar
    

    I added the other jars to my media folder and served them up using the jnpl –

    <resources>
            <!-- Application Resources -->
            <j2se version="1.6+"
                  href="http://java.sun.com/products/autodl/j2se" />
            <jar href="http://127.0.0.1:18123/media/java/CacheScan.jar" main="true" />
            <jar href="http://127.0.0.1:18123/media/java/JTwain.jar"  />
            <jar href="http://127.0.0.1:18123/media/java/AspriseJavaPDF.jar"  />
            <jar href="http://127.0.0.1:18123/media/java/plugin.jar" />
    </resources>
    

    Lastly I signed all the unsigned jars (both mine and the AspriseJavaPDF.jar). I did this outside of Eclipse. see http://download.oracle.com/javase/tutorial/deployment/jar/signindex.html

    Having unsigned Jars was the problem so thanks to Perception & Paulo Ebermann for the comments above. Hope this is helpful for somebody.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.