Oct 17, 2013

View huge text size file in windows

You can do it either with 010 Editor (Free or License) edition but you can do it also using Power Shell.


In power shell write "gc filename.ext -first X"

First means first lines
X means total lines

In this case "gc temp.csv -first 150" we will see the first 150 lines in the temp.csv file.



Aug 8, 2013

Oracle Sql Developer Recyclebin

I wondered yesterday what does this means and why do i have there many “objects” (tables mostly).

Well, it’s simple.

Oracle keeps in the recycle bin information about all dropped objects. 
What ? what's for ?
Oracle keeps this information for “just in case” we will need to recover the table the index whatever.
Which is actually means that the quote space won’t be decreased as result of a drop and will still be count until we will specifically do purge to this data for the recycle bin.

You can see what’s inside your recycle bin using “select * from recyclebin”;


If you want you can read more about it here http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables011.htm.


Since most of don’t have DBA privileges, this “PURGE RECYCLEBIN;” will delete only our recyclebin.

If you ask me, I think that this option should be enabled (the recycle bin) only in production, other places like development shouldn’t have this kind of fallback backup.


Hoped it helped understanding.
Dor

Aug 6, 2013

javax.el.ELException: The identifier [public] is not a valid Java identifier as required by section 1.19 of the EL specification (Identifier ::= Java language identifier). This check can be disabled by setting the system property org.apache.el.parser.SKIP_IDENTIFIER_CHECK to true.

Had this lately

javax.el.ELException: The identifier [public] is not a valid Java identifier as required by section 1.19 of the EL specification (Identifier ::= Java language identifier). This check can be disabled by setting the system property org.apache.el.parser.SKIP_IDENTIFIER_CHECK to true.
org.apache.el.parser.AstDotSuffix.setImage(AstDotSuffix.java:46)
org.apache.el.parser.ELParser.DotSuffix(ELParser.java:1069)
org.apache.el.parser.ELParser.ValueSuffix(ELParser.java:1035)
org.apache.el.parser.ELParser.Value(ELParser.java:980)
org.apache.el.parser.ELParser.Unary(ELParser.java:950)
org.apache.el.parser.ELParser.Multiplication(ELParser.java:714)
org.apache.el.parser.ELParser.Math(ELParser.java:634)
org.apache.el.parser.ELParser.Compare(ELParser.java:446)
org.apache.el.parser.ELParser.Equality(ELParser.java:340)
org.apache.el.parser.ELParser.And(ELParser.java:284)
org.apache.el.parser.ELParser.Or(ELParser.java:228)
org.apache.el.parser.ELParser.Choice(ELParser.java:185)
org.apache.el.parser.ELParser.Expression(ELParser.java:177)
org.apache.el.parser.ELParser.NonLiteral(ELParser.java:1183)
org.apache.el.parser.ELParser.ValuePrefix(ELParser.java:1019)
org.apache.el.parser.ELParser.Value(ELParser.java:968)
org.apache.el.parser.ELParser.Unary(ELParser.java:950)
org.apache.el.parser.ELParser.Multiplication(ELParser.java:714)
org.apache.el.parser.ELParser.Math(ELParser.java:634)
org.apache.el.parser.ELParser.Compare(ELParser.java:446)
org.apache.el.parser.ELParser.Equality(ELParser.java:340)
org.apache.el.parser.ELParser.And(ELParser.java:284)
org.apache.el.parser.ELParser.Or(ELParser.java:228)
org.apache.el.parser.ELParser.Choice(ELParser.java:185)
org.apache.el.parser.ELParser.Expression(ELParser.java:177)
org.apache.el.parser.ELParser.NonLiteral(ELParser.java:1183)
org.apache.el.parser.ELParser.ValuePrefix(ELParser.java:1019)
org.apache.el.parser.ELParser.Value(ELParser.java:968)
org.apache.el.parser.ELParser.Unary(ELParser.java:950)


Solution for me was easy and simple
Adding this to the vm arguments
-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=true

Apr 17, 2013

SimpleMappingExceptionResolver ignore exception

Lately i wanted to ignore ClientAbortException that raised by tomcat (catalina), instead of having a lot of stacktrace relates to this exception to have some line of my own, custom line in the log like "Client abort exception." and that's it.


There are many ways to do it, one way is using the @ExceptionHandler annotation from spring within the controller. But i have found that this solution obliged me to do so in all the relevant handlers.

Better way i think, extending the SimpleMappingExceptionResolver , overrding resolveException method,
When the exception arrive, check if the simple class name of the class inside it contains "ClientAbortException".

Why this way ?
This way you keep your code decoupled from tomcat catalina , better practice i think.


hoped i helped.

Dor

Dec 27, 2012

EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0

Hi,
Lately i had this exception in my spring jdbc part of code. What it
actually means is that your query probably doesn't return any value while you are trying to assign the query result into let's say 'int'.

Change the query from queryForInt to regular query that returns a list. Use row mapper also.
Check the list, if it's empty, nothing returned from the query, decide what to do, else if the list isn't empty
and contain data, also, decide what to do.
It then will work for you.



Hoped i helped,
Dor

Sep 14, 2012

ERROR: Failed to parse POMs

Strange situation where the local build success but the build on the jenkins fails. 

After investigation i have noticed that one of the developers have add a tab somewhere in the pom. 
The tab \t character cause this error in the jenkins

Removing this character solved the issue. Of course i have reported that also to the jenkins guys. 


Hoped it helped you,

Dor

Aug 7, 2012

java.awt.color.CMMException: Invalid image format

Caused by the metadata within the picture file.
Try to save the file without the metadata (usually camera metadata). Since this version doesn't support this metadata.
Another solution, use JAI instead.


Hoped that it helped,
Dor