Correct StreamBase Studio maven error: Archive for required library is not a valid ZIP file

Correct StreamBase Studio maven error: Archive for required library is not a valid ZIP file

book

Article ID: KB0082892

calendar_today

Updated On:

Products Versions
TIBCO Streaming -

Description

StreamBase Studio 10 uses Apache Maven to build projects. If Eclipse has cached a previously incomplete download of a file currently in your local repository, then you may see this error:
 
Archive for required library: '/Users/{user}/.m2/repository/org/apache/xmlbeans/xmlbeans/2.6.0/xmlbeans-2.6.0.jar' in project 'my_project' cannot be read or is not a valid ZIP file.
(The error may relate to a different jar.)
 

Issue/Introduction

Steps to correct the Eclipse repository cache state.

Resolution

This error may be due to having libraries defined on the Project Build Path. The only items that should be on the Build Path for a StreamBase maven-based project are "JRE System Library" and "Maven Dependencies" (see Libraries tab in Java Build Path settings). All other library reference should be managed through POM dependencies only. Check whether additional libraries have been added to the Project Build Path. If so, remove them and re-add them (if needed) to the project POM Dependencies.

If this error results after import of an existing project this may be due to a Studio internal error. Please make a copy of the {workspace}\.metadata\.log file for analysis if you contact Support. This has been resolved in the past by importing the project into a new workspace.

If this error persists (or has not resulted from an import), then it may be due to a corrupted file in the local Maven repository.

To correct remaining repository errors, follow these steps:

1. Use menu: Window > Show View > Other..., Maven > Maven Repositories, select and open. 

2. In the Maven Repositories view, expand "Local Repositories", right-click "Local Repository (your .m2)" and choose Rebuild Index.

3. Right-click the Project folder and use menu: Maven > Update Project, in the dialog select all checkboxes except "Offline" and click OK. This will double-check the .m2/ repository and clear any left-over error markers.

If errors occurred during either of these steps, repeat steps 2. and 3. once (Rebuild Index, Update Project) and see if the same problems occur or if the error changes.

This should resolve the "not a valid ZIP file" error, unless new errors occur (like timeouts accessing Maven Central).

Additional background information is available from the referenced KB articles.

Additional Information

- StreamBaseNature is missing prerequisite nature
  https://support.tibco.com/s/article/ka11a000000HuU7AAK/StreamBaseNature-is-missing-prerequisite-nature
- Adding Libraries to a StreamBase Maven Project
  https://support.tibco.com/s/article/ka11a000000HsxbAAC/Adding-Libraries-to-a-StreamBase-Maven-Project