New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected end of ZLIB input stream #647

Open
htrinkl opened this Issue Nov 8, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@htrinkl

htrinkl commented Nov 8, 2017

I get a Unexpected end of ZLIB input stream error when I try to read a model, I committed before. I have tried the SingleCheckinAndDownload.java example and the error occurs to. After a commit the 3D-view in bimviews does also not work. There is only the loading project bar but without progress. Is there something wrong with my code or is there a problem with the server?

Error :

[AWT-EventQueue-0] INFO org.bimserver.emf.SharedJsonDeserializer - # Objects: 1772
java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at org.apache.http.client.entity.LazyDecompressingInputStream.read(LazyDecompressingInputStream.java:67)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
at org.bimserver.client.ClientIfcModel.loadGeometry(ClientIfcModel.java:347)
at org.bimserver.client.ClientIfcModel.loadDeep(ClientIfcModel.java:303)
at org.bimserver.client.ClientIfcModel.(ClientIfcModel.java:115)
at org.bimserver.client.BimServerClient.getModel(BimServerClient.java:202)
at at.ac.get.opensourcebimeditor.globalsets.setproject(globalsets.java:316)
at at.ac.get.opensourcebimeditor.globalsets.setproject(globalsets.java:491)
at at.ac.get.opensourcebimeditor.GUI.ProjectGUI.jComboBox1ActionPerformed(ProjectGUI.java:410)
at at.ac.get.opensourcebimeditor.GUI.ProjectGUI.access$000(ProjectGUI.java:30)
at at.ac.get.opensourcebimeditor.GUI.ProjectGUI$1.actionPerformed(ProjectGUI.java:147)
at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1258)
at javax.swing.JComboBox.setSelectedItem(JComboBox.java:586)
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:622)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:861)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:510)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Code for read model:

public static BimServerClient getclient(String url, String user, String passwd) {
    try {
        JsonBimServerClientFactory factory = new JsonBimServerClientFactory(url);
        try (BimServerClient client = factory.create(new UsernamePasswordAuthenticationInfo(user, passwd))) {
            return client;
        } catch (org.bimserver.shared.exceptions.UserException ex) {
            IO.outerror("Benutzername oder Passwort wurde nicht akzeptiert!", "Fehler bei Verbindung");
            return null;
        } catch (org.bimserver.shared.reflector.ReflectorException ex) {
            IO.outerror("Server konnte nicht gefunden werden!", "Fehler bei Verbindung");
            return null;
        } catch (Exception ex) {
            IO.outerror(ex.getMessage(), "Fehler bei Verbindung");
            return null;
        }
    } catch (BimServerClientException ex) {
        Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
        return null;
    }
}

 public void setproject(org.bimserver.interfaces.objects.SProject project) {
    this.project = project;
    setisifc();
    if (project.getLastRevisionId() < 0) {
        return;
    }
    javax.swing.JDialog d = createwait();
    try {
        model = client.getModel(project, project.getLastRevisionId(), true, true, true);
        if (isifc2()) {
            ifc2ProductList = model.getAllWithSubTypes(org.bimserver.models.ifc2x3tc1.IfcProduct.class);
        }
        if (isifc4()) {
            ifc4ProductList = model.getAllWithSubTypes(org.bimserver.models.ifc4.IfcProduct.class);
        }
    } catch (UserException | ServerException ex) {
        Logger.getLogger(globalsets.class.getName()).log(Level.SEVERE, null, ex);
    }
    d.dispose();
}

Code for commit:

private void jButtoncommitActionPerformed(java.awt.event.ActionEvent evt) {                                              
    try {
        String comtext = JOptionPane.showInputDialog("Bitte Text für commit eingeben:  ");
        if (comtext == null) {
            return;
        }
        IO.o("TransactionID: " + globalset.getmodel().getTransactionId());
        globalset.getmodel().fixOidCounter();
        globalset.getmodel().fixOids();
        //globalset.getmodel().fixInverseMismatches();

        //globalset.getmodel().checkDoubleOidsPlusReferences();
        //globalset.getclient().commit(globalset.getmodel(), comtext);
       // globalset.getmodel().checkin(globalset.getproject().getRid(), comtext);
        javax.swing.JDialog d = globalset.createwait("Daten werden auf den Bimserver übertragen!");
        IO.o(globalset.getmodel().commit(comtext));
        d.dispose();
        IO.o("commited");
        IO.o(globalset.getmodel().getTransactionId());
        d = globalset.createwait("Model des Bimservers wird neu geladen!");
        //model = client.getModel(project, project.getLastRevisionId(), true, true, true);
        globalset.setmodel(globalset.getclient().getModel(globalset.getproject(), 
        globalset.getproject().getLastRevisionId(), true, true));
        d.dispose();
        IO.o(globalset.getmodel().getTransactionId());
    } catch (ServerException ex) {
        Logger.getLogger(ifcGUI.class.getName()).log(Level.SEVERE, null, ex);
    } catch (UserException ex) {
        Logger.getLogger(ifcGUI.class.getName()).log(Level.SEVERE, null, ex);
    } catch (PublicInterfaceNotFoundException ex) {
        Logger.getLogger(ifcGUI.class.getName()).log(Level.SEVERE, null, ex);
    } catch (BimServerClientException ex) {
        Logger.getLogger(ifcGUI.class.getName()).log(Level.SEVERE, null, ex);
    }
}                                             
@htrinkl

This comment has been minimized.

Show comment
Hide comment
@htrinkl

htrinkl Nov 13, 2017

I have founded a workaround:

If you download the IFC-File with:
Bimserverclient.getServiceInterface().download(Collections.singleton(globalset.getproject().getLastRevisionId()), DefaultQueries.allAsString(), serializer.getOid(), true);

you get a ifc-file with the line: "FILE_SCHEMA (('null'));"
If you change it to "FILE_SCHEMA (('IFC2X3'));" you can checkin the file and the Unexpected end of ZLIB input stream error is gone.

Maybe the ifc-schema is not written on commit?

htrinkl commented Nov 13, 2017

I have founded a workaround:

If you download the IFC-File with:
Bimserverclient.getServiceInterface().download(Collections.singleton(globalset.getproject().getLastRevisionId()), DefaultQueries.allAsString(), serializer.getOid(), true);

you get a ifc-file with the line: "FILE_SCHEMA (('null'));"
If you change it to "FILE_SCHEMA (('IFC2X3'));" you can checkin the file and the Unexpected end of ZLIB input stream error is gone.

Maybe the ifc-schema is not written on commit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment