Monthly Archives: November 2013

How to solve Tomcat 7: deploy war file exceed limit

Tomcat as default works for deploy war file only as much as 50 MB. It means if we deploy more than that capacity, tomcat will be error. This is the example :

DEPLOYMENT GOES ERROR

The solution is very easy, we just need to change Tomcat capacity to deploy in : Tomcat 7.0\webapps\manager\WEB-INF\web.xml.

<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>

tag and tag are displayed in Byte mode. To upgrade the capacity ex: 60MB we need to convert into Byte first 60 * 1024 * 1024 = 62914560.

<multipart-config>
<!-- 60MB max -->
<max-file-size>62914560</max-file-size>
<max-request-size>62914560</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config>

Save the web.xml and redeploy war file.

DEPLOYMENT SUCCESFULL

Advertisements

How To Describe a Table in H2 Database

H2 database management system has several differences from another DBMS. H2 is build on java programming language. It is fast, simple and very powerful for java program which need database connection. H2 is also become default DBMS for grails framework. Yesterday, i need to see (description) from a table in my program. when i connect into h2 console, i can’t see description of a table through ordinary command “describe table [table_name]”. No, it doesn’t work. As you can see on image below, there is no auto complete for that command.

SYNTAX ERROR COME

I decide to googling, and i found this command “SHOW COLUMNS FROM [TABLE_NAME]”. Finally, it work just like describe in MYSQL.

SUCCESS SHOW COLUMN FOR TABLE