Search
Calendar
April 2024
S M T W T F S
« Sep    
 123456
78910111213
14151617181920
21222324252627
282930  
Your widget title
Archives

Archive for the ‘en-US’ Category

PostHeaderIcon MultiException[java.lang.RuntimeException: Error scanning file]

Case

I run a project with JSF 2 / PrimeFaces 5 (BTW: it rocks!) / Spring 4 / Jetty 9 / Java 8:

MultiException java.lang.RuntimeException: Error scanning file SummerBean.class, java.lang.RuntimeException: Error scanning entry .../SummerService.class from jar file:/.../spring-tier-1.0-SNAPSHOT.jar, java.lang.RuntimeException: Error scanning entry .../SummerServiceImpl.class from jar file:/.../spring-tier-1.0-SNAPSHOT.jar
        at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations(AnnotationConfiguration.java:530)

Explanation

The error occurs because of a conflict on the JARs of ASM.

Fix

You have to override Jetty’s dependencies to ASM.
In Maven’s POM, amend Jetty plugin to force ASM versions:

<plugin>
   <groupId>org.eclipse.jetty</groupId>
   <artifactId>jetty-maven-plugin</artifactId>
   <version>${jetty.version}</version>
   <dependencies>
      <dependency>
         <groupId>org.ow2.asm</groupId>
         <artifactId>asm</artifactId>
         <version>5.0.2</version>
         </dependency>
         <dependency>
         <groupId>org.ow2.asm</groupId>
         <artifactId>asm-commons</artifactId>
         <version>5.0.2</version>
         </dependency>
      </dependencies>
<!-- ... -->
</plugin>

Then it should work 😉

PostHeaderIcon SizeLimitExceededException: the request was rejected because its size (…) exceeds the configured maximum

Stacktrace

On deploying a WAR in Tomcat:

org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (128938160) exceeds the configured maximum (52428800)

Quick fix

Edit the file $CATALINA_HOME/webapps/manager/WEB-INF/web.xml
Replace the block

  <multipart-config>
       <!-- 50MB max -->
        <max-file-size>52428800</max-file-size>
       <max-request-size>52428800</max-request-size>
        <file-size-threshold>0</file-size-threshold>
      </multipart-config>      

with:

  <multipart-config>
       <!-- 200 MB max -->
        <max-file-size>209715200</max-file-size>
       <max-request-size>209715200</max-request-size>
        <file-size-threshold>0</file-size-threshold>
      </multipart-config>
       

PostHeaderIcon Mount a shared drive with VirtualBox

Case

You have to share some content between the host (eg: Linux Mint) and the resident (eg: Windows 7) systems, with Virtual Box.

Solution

  • In the resident system, go to Virtual Box, then: Machine >Settings > Shared Folders > on the right:Add > check automount and permanent, browse to the folder, let’s say D:\sharedFolder
  • Launch the VM.
  • Execute a terminal in host system:
  • Grant rights of group vboxsf to user mint:

sudo gpasswd -a mint vboxsf

  • Create a “local” folder:

mkdir ~/sharedFolder

  • Mount the folder sharedFolder on /home/ :

sudo mount -t vboxsf -o uid=1000,gid=1000 sharedFolder ~/sharedFolder

PostHeaderIcon (long tweet) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘type=InnoDB’ at line 1

Stacktrace

org.hibernate.tool.hbm2ddl.SchemaExport - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 1

Quick fix

In JPA configuration, replace:
datasource.dialect = org.hibernate.dialect.MySQLInnoDBDialect
with:
datasource.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
Actually, Java driver for MySQL 5.5+ is not backward compatible with the SQL dialect MySQLInnoDBDialect.

PostHeaderIcon (long tweet) Run MS-DOS command as super user

How to run a MS-DOS command terminal with administrator priviledges, in Windows 7?
Let’s say you need execute cmd with the account admin: launch runas /user:admin cmd.
Windows will ask you to enter the admin password and then will open a CMD prompt in admin mode.