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 7309097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:40:08+00:00 2026-05-28T23:40:08+00:00

I am getting the below error and stack trace while trying to save/create a

  • 0

I am getting the below error and stack trace while trying to save/create a package in my save method of groovy controller.

Error 500: Executing action [save] of controller [se.accumulate.wizard.SubmissionController] caused exception:
  could not deserialize; nested exception is
    org.hibernate.type.SerializationException: could not deserialize java.io.StreamCorruptedException
      at java.util.Hashtable.reconstitutionPut(Hashtable.java:889)
      at java.util.Hashtable.readObject(Hashtable.java:861)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at se.accumulate.wizard.PackagingService$$EnhancerByCGLIB$$2b5048f.createPackage(<generated>)

Any ideas/hints on resolving this issue. I have checked for any inconsistencies of the domain with the Database, etc. everything looks fine to me.

sample code :

def createPackage(Submission submission){
        logger.info("Creating submission package");
        def xml = createZip(submission);
    }

def createZip(Submission submission){
        def sw = new StringWriter()
        def xml = new groovy.xml.MarkupBuilder(sw);
        Customer customer = Customer.get(submission.customerId);
        String custDir = customer.ftpCustomerTempDirectory
        logger.info("Zip file: " + submission.fileName);

        final int BUFFER = 2048;
        try {
            String tmpFileName = custDir+"/" + java.util.UUID.randomUUID().toString().replaceAll("-", "") + ".zip";

            FileOutputStream fos = new FileOutputStream(tmpFileName);
            BufferedOutputStream dest;
            ZipOutputStream zos = new ZipOutputStream(fos);
            FileInputStream fis = new FileInputStream(custDir+"/" + submission.fileName);
            ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
            ZipEntry entry;
            while((entry = zis.getNextEntry()) != null) {
                //System.out.println("Extracting: " +entry);

                if (!entry.isDirectory()) {
                    if((entry.getName().toLowerCase().endsWith(".jar") || entry.getName().toLowerCase().endsWith(".jad") || entry.getName().toLowerCase().endsWith(".apk"))){
                        int count;
                        byte[] data = new byte[BUFFER];

                        String name = entry.getName();
                        if (name.indexOf('/') >= 0) {
                            String[] parts = name.split('/');
                            name = parts[parts.length - 1];
                        }
                        zos.putNextEntry(new ZipEntry("Applications/" + name));
                        while ((count = zis.read(data, 0, BUFFER))!= -1) {
                            zos.write(data, 0, count);
                        }
                        zos.closeEntry();
                    }
                }
            }
            zis.close();

            if (submission.applicationImage != null) {
                zos.putNextEntry(new ZipEntry("thumbnail_60x60.png"));
                zos.write(submission.applicationImage);
                zos.closeEntry();
            }

            zos.putNextEntry(new ZipEntry("Submission.xml"));
            zos.write(createXml(submission).toString().getBytes("UTF-8"));
            zos.close();


            FtpClientService fcs = new FtpClientService();
            fcs.putFile(customer.ftpUser, customer.ftpPassword, customer.ftpHost, customer.ftpPackagedDirectory, tmpFileName, submission.outputFileName);
            logger.info("check 1")
            if (!new File(tmpFileName).delete()) {
                logger.info("Could not delete tmp file " + tmpFileName);
            }
            logger.info("check 2")
            if (!new File(custDir+"/" + submission.fileName).delete()) {
                logger.info("Could not delete submission file " + submission.fileName);
            }
            logger.info("check 3")
        } catch(Exception e) {
            e.printStackTrace();
        }
        logger.info("check 4")
        return "sw";
    }

All the logs check 1 to 4 have been displayed and the expected output/file has been created but this exception has been thrown…

My domain class :(Submission.groovy which extneds wizard)

package se.accumulate.wizard

class Submission extends Wizard {
    long operatingSystemId
    long deploymentId
    int newOrExisting

    String applicationName
    String applicationShortName
    String reportingName
    byte[] applicationImage
    long contentProviderId

    String fileName
    String outputFileName

    Properties deviceMapping

    long applicationId

    int overwriteExistingApplicationDetails

    static constraints = {
        operatingSystemId (nullable:true)
        deploymentId (nullable:true)
        newOrExisting (nullable:true)
        applicationName (nullable:true)
        applicationShortName (nullable:true)
        reportingName (nullable:true)
        applicationImage (nullable:true, maxSize: 1048576)
        contentProviderId (nullable:true)
        fileName (nullable:true)
        deviceMapping (nullable:true, maxSize: 5242880)
        outputFileName (nullable:true)
    }
}

package se.accumulate.wizard

abstract class Wizard {
    Date dateCreated
    Date lastUpdated
    long createdByUserId
    long customerId
    Boolean isConfirmed = false
    int pageTracker
}

My DB table submission description as below :(sorry for the improper formatting)

Field Type Null Key Default

‘application_id’, ‘bigint(20)’, ‘NO’, ”, NULL, ”
‘application_image’, ‘blob’, ‘YES’, ”, NULL, ”
‘application_name’, ‘varchar(255)’, ‘YES’, ”, NULL, ”
‘cms_id’, ‘varchar(255)’, ‘YES’, ”, NULL, ”
‘content_provider_id’, ‘bigint(20)’, ‘NO’, ”, NULL, ”
‘created_by_user_id’, ‘bigint(20) unsigned’, ‘NO’, ”, NULL, ”
‘date_created’, ‘datetime’, ‘NO’, ”, NULL, ”
‘deployment_id’, ‘bigint(20)’, ‘NO’, ”, NULL, ”
‘device_mapping’, ‘blob’, ‘YES’, ”, NULL, ”
‘file_name’, ‘varchar(255)’, ‘YES’, ”, NULL, ”
‘is_confirmed’, ‘tinyint(1)’, ‘NO’, ”, NULL, ”
‘last_updated’, ‘datetime’, ‘NO’, ”, NULL, ”
‘new_or_existing’, ‘int(11)’, ‘NO’, ”, NULL, ”
‘operating_system_id’, ‘bigint(20)’, ‘NO’, ”, NULL, ”
‘overwrite_existing_application_details’, ‘int(11)’, ‘NO’, ”, NULL, ”
‘customer_id’, ‘bigint(20)’, ‘YES’, ‘MUL’, NULL, ”
‘output_file_name’, ‘varchar(255)’, ‘YES’, ”, NULL, ”
‘reporting_name’, ‘varchar(255)’, ‘YES’, ”, NULL, ”
‘application_short_name’, ‘varchar(255)’, ‘YES’, ”, NULL, ”
‘page_tracker’, ‘int(11)’, ‘YES’, ”, NULL, ”

part of another method which would be called from createPackage(after changing this method, the error is showing up)- i have just filtered the “?” from the filename

def createXml(Submission submission){
    Application application = Application.get(submission.getApplicationId());
    ContentProvider contentProvider = ContentProvider.get(submission.getContentProviderId());

    Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
    Element rootElement = doc.createElement("game");
    rootElement.setAttribute("title", submission.applicationName);
    rootElement.setAttribute("short", submission.applicationShortName);
    rootElement.setAttribute("externalRef", application.cmsId);
    rootElement.setAttribute("contentPartner", contentProvider.name);

    if (submission.applicationImage != null) {
        Element image = doc.createElement("image");
        image.setAttribute("type", "thumbnail");
        image.setAttribute("mime-type", "image/png");
        image.setAttribute("width", "60");
        image.setAttribute("height", "60");
        image.setTextContent("thumbnail_60x60.png");
        rootElement.appendChild(image);
    }

    Properties ps = submission.deviceMapping;
    Properties dm = (Properties) ps;
    for (def device : dm) {
        device.key = device.key.split("\\?")[0];
        logger.debug("key=${device.key}, value=${device.value}")
        if (!(device.value == null || "null".equalsIgnoreCase(device.value))) {
            logger.info("Adding handset: " + device.value);
            Element handset = doc.createElement("handset");
            handset.setAttribute("name", device.value);

            String name = device.key;
            if (name.indexOf('/') >= 0) {
                String[] parts = name.split('/');
                name = parts[parts.length - 1];
            }

            if (name.toLowerCase().endsWith(".jad")) {
                // java and blackberry
                Element jadFile = doc.createElement("jadfile");
                jadFile.setTextContent("Applications/" + name);
                handset.appendChild(jadFile);

                /*
                name = getJarFileName();
                if (name.indexOf('/') >= 0) {
                    String[] parts = name.split('/');
                    name = parts[parts.length - 1];
                }*/

                Element jarFile = doc.createElement("jarfile");
                jarFile.setTextContent("Applications/" + name.replace(".jad", ".jar"));
                handset.appendChild(jarFile);
            }
            else {
                // android
                Element jarFile = doc.createElement("jarfile");
                jarFile.setTextContent("Applications/" + name);
                handset.appendChild(jarFile);
            }

            rootElement.appendChild(handset);
        }
    }
    doc.appendChild(rootElement);

    StringWriter xmlString = new StringWriter();
    try{
        Result result = new StreamResult(xmlString);
        Source source = new DOMSource(doc);

        // Write the DOM document to the file
        Transformer xformer = TransformerFactory.newInstance().newTransformer();
        xformer.transform(source, result);

    } catch (Exception e){
        e.printStackTrace();
    }
    logger.info("XML: " + xmlString.toString());

    return  xmlString;
}
  • 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-28T23:40:09+00:00Added an answer on May 28, 2026 at 11:40 pm

    By

    changing the properties to String in the createXml method, the error has been eliminated….

    Properties ps = submission.deviceMapping;
        Properties dm = (Properties) ps;
        for (def device : dm) {
            device.key = device.key.split("\\?")[0];
    

    replaced with

    java.util.Properties dm = submission.deviceMapping;
            for (String fileName : dm.keys()) {
                String device = dm.getProperty(fileName);
                fileName = fileName.split("\\?")[0];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the below error when executing my application on a Windows XP
I'm trying to build a java application with gcj but getting the error below.
I am facing a peculiar issue. Below is the stack trace of what error
I'm getting the error below, every once in a while, when I try to
I am getting a NullPointerException at SuggestionSpan. (Stack trace included below). As the stack
I was changing the vc++ include directory with new paths suddenly getting below error
i'm getting the below error, When compiling the Asp.Net web deploy project Could not
I am getting the error below when I call my WCF service. What am
We are getting the error below calling c:\windows\syswow64\regsvr32.exe on Windows Server 2008 R2 x64.
I'm getting the error below for this SQL statement in VB.Net 'Fill in the

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.