samuraiza / jzebra

Automatically exported from code.google.com/p/jzebra
0 stars 0 forks source link

Trouble deploying new signed 1.8.0 jZebra on IIS #206

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm having trouble deploying a signed qz / jzebra applet version 1.8.0 I just 
bought. My old jZebra version worked fine on the same server. The new applet 
works when running IIS Express locally during development. However when 
deploying to IIS I get TypeError: Object doesn't support property or method 
'isActive' when calling isActive() from javascript on the applet, so it seems 
the applet does not load? 

I have verified that Java 7 update 51 is installed and working in the browser 
(using http://java.com/en/download/installed.jsp)

I have tried adding .jnlp as mime type in IIS (application/x-java-jnlp-file). 

I tried to deploy using the applet tag (as I used to): 

<applet name="jZebra" code="qz.PrintApplet.class" archive="<%= 
System.Configuration.ConfigurationSettings.AppSettings["jZebra-jar-url"] %>"
        width="0" height="0">
        <param name="printer" value="jzebratest">
        <param name="jnlp_href" value="qz-print_jnlp.jnlp">
        <param name="cache_option" value="plugin">
        <param name="disable_logging" value="false">
        <param name="initial_focus" value="false">
        <!-- <param name="sleep" value="200"> -->
    </applet>

I also tried deploying using deployJava() and the sample javascript that was 
included, i.e.: 

<script type="text/javascript">

    deployQZ();

    function deployQZ() {
        var attributes = {
            id: "jZebra", code: 'qz.PrintApplet.class',
            archive:'qz-print.jar', width:1, height:1};
        var parameters = {jnlp_href: 'qz-print_jnlp.jnlp', 
            cache_option:'plugin', disable_logging:'false', 
            initial_focus:'false'};
        if (deployJava.versionCheck("1.7+") == true) {}
        else if (deployJava.versionCheck("1.6+") == true) {
            attributes['archive'] = 'jre6/qz-print.jar';
            parameters['jnlp_href'] = 'jre6/qz-print_jnlp.jnlp';
        }
        deployJava.runApplet(attributes, parameters, '1.5');
    }

    function isLoaded() {
    if (!jZebra) {
        alert('Error:\n\n\tPrint plugin is NOT loaded!');
        return false;
    } else {
        try {
            if (!jZebra.isActive()) {
                alert('Error:\n\n\tPrint plugin is loaded but NOT active!');
                return false;
            }
        } catch (err) {
            alert('Error:\n\n\tPrint plugin is NOT loaded properly! Error: ' + err);
            return false;
        }
    }
    return true;
    }

In all cases isLoaded() fails on qz.isActive() (when running on IIS) with error 
"Print plugin is NOT loaded properly! Error: TypeError: Object doesn't support 
property or method 'isActive'". 

My Java Console opens when I access the page and shows: 

Java Plug-in 10.51.2.13
Using JRE version 1.7.0_51-b13 Java HotSpot(TM) Client VM
User home directory = C:\Users\petd
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------

I tried lowering my Security Level in Java Control Panel on the client to 
"Medium". 

Both my local IIS Express and the IIS server is accessed over HTTPS / SSL. The 
IIS server has a valid SSL certificate (my local development machine does not). 

Tried both with IE 11 and Chrome. 

Any suggestions? 

Original issue reported on code.google.com by per.thor...@gmail.com on 16 Jan 2014 at 2:57

GoogleCodeExporter commented 9 years ago
Oh, it probably was that I had to specify the complete URL in 
jnlp_href-parameter, e.g.:
            function deployQZ() {
                var attributes = {
                    id: "jZebra", code: 'qz.PrintApplet.class',
                    archive:'qz-print.jar', width:1, height:1};
                var parameters = {jnlp_href: 'https://myhost/jZebra/qz-print_jnlp.jnlp', 
                    cache_option:'plugin', disable_logging:'false', 
                    initial_focus:'false'};
                if (deployJava.versionCheck("1.7+") == true) {}
                else if (deployJava.versionCheck("1.6+") == true) {
                    attributes['archive'] = 'jre6/qz-print.jar';
                    parameters['jnlp_href'] = 'jre6/qz-print_jnlp.jnlp';
                }
                deployJava.runApplet(attributes, parameters, '1.5');
            }

Original comment by per.thor...@gmail.com on 17 Jan 2014 at 10:41

GoogleCodeExporter commented 9 years ago
@Per,

Since you are a premium subscriber, we can offer remote assistance with this 
issue.  Let me know if you've been able to resolve this or not.

-Tres

Original comment by tres.fin...@gmail.com on 17 Jan 2014 at 2:21

GoogleCodeExporter commented 9 years ago
No problem with jZebra, it was my own lack of understanding of jnlp as you
can see from my comment on your site. You may close the issue and delete
the entry (unless it's any help to someone else).

Thanks for contacting me.

Original comment by per.thor...@gmail.com on 17 Jan 2014 at 8:50

GoogleCodeExporter commented 9 years ago

Original comment by tres.fin...@gmail.com on 17 Jan 2014 at 9:27

GoogleCodeExporter commented 9 years ago
i have the same problem.... 

Original comment by ivangome...@gmail.com on 28 Apr 2014 at 6:43

GoogleCodeExporter commented 9 years ago
By default IIS blocks the JNLP file extension and you can enable it manually 
via mimetypes.  If you are a premium subscriber, please open a support request 
via the standard channel.

Original comment by tres.fin...@gmail.com on 28 Apr 2014 at 7:33

GoogleCodeExporter commented 9 years ago
In the below isLoaded() frunction, qz does not have isActive and append methods,
I have added my aspx page in the exception list in Java security 
Kindly suggest your valuable comments on the same

 function isLoaded() {
            if (!qz) {
                alert('Error:\n\n\tPrint plugin is NOT loaded!');
                return false;
            } else {
                try {
                    if (!qz.isActive()) {
                        alert('Error:\n\n\tPrint plugin is loaded but NOT active!');
                        return false;
                    }
                } catch (err) {
                    alert('Error:\n\n\tPrint plugin is NOT loaded properly!');
                    return false;
                }
            }
            return true;
        }

Original comment by asi...@rufutech.com on 31 Oct 2014 at 5:52

GoogleCodeExporter commented 9 years ago
I'm not sure exactly what you are asking, but commenting on a closed bug report 
for help with your issue probably is the wrong place to ask this type of 
question.

Feel free to start a new discussion with all of the relevant details here:

http://qzindustries.com/support

Original comment by tres.fin...@gmail.com on 1 Nov 2014 at 1:47