Some Trials & a lot of Errors
I tried a bunch of framework and other language and I usually feel overwhelm when its time to do something real with what I've learned. So that why I created this site, to write my progress and help some noob like me that stumble into the sames problems.
Browse: Home / java

java

Constructor XXX in enum XXX cannot be applied to given types in mapstruct

By Chris on May 20, 2020

I was having that weird error when I was working with mapstruct, turn out that the default java version for mapstruct is java 6. Since our project was in java 11 I was getting the error “Constructor XXX in enum XXX cannot be applied to given types”. My starting config was : <dependencies> <dependency> <groupId>org.mapstruct</groupId> […]

Posted in error, java | Tagged java, java8, mapstruts, maven | Leave a response

List Return a java.lang.UnsupportedOperationException when adding or removing a element

By Chris on October 12, 2014

While trying to remove a element after creating a List from a array using the Array.asList(array[]) method I’ve stumbled on that error. java.lang.UnsupportedOperationException at java.util.AbstractList.add(AbstractList.java:131) at java.util.AbstractList.add(AbstractList.java:91) Then I remember this, list created by the Arrays.asList method are immutable Same goes for empty lists. So instead create a arraylist : List<String> list = new ArrayList<String>(Arrays.asList(split));

Posted in java, prog | Tagged arraylist, java, java.util.List | Leave a response

JENKINS: How to fix a java.net.NoRouteToHostException.

By Chris on October 5, 2014

Our build server (jenkins) had that error   BUILD FAILED com.jcraft.jsch.JSchException: java.net.NoRouteToHostException: No route to host Full stack trace below if you really need it. I assume there was a problem with where Jenkins was deploying the apps or at a issue trying to run integration test on the remote server. After talking to IT […]

Posted in prog | Tagged build server, java, jenkins | Leave a response

Why is String not sorting with the Local ?

By Chris on September 28, 2014

Comparing and sorting Strings might not work out like you expected specially when your dealing with a language other than English. Normally comparing strings in done with simple Unicode ordering. If you want to have localized ordering (the kind expected by an end user) you need to use a Collator. Commonly used String methods such […]

Posted in java, prog | Tagged collator, java, sorting, String | Leave a response

Lessons learned: Why struts not working ?

By Chris on September 2, 2014

If you happen to rename your folder that contain your jsp and js, don’t forget to update the struts config (and the tiles). This will save your precious time even hours …

Posted in java | Tagged java, javascript, js, jsp, struts | Leave a response

Hibernate Oracle to MySQL: changing the generator class

By Chris on July 9, 2014

Really quick post to a problem I’ve got un hibernate when converting to mySQL, I’ve found that the problem was because we were using a generator class “sequence” and in mySQL we needed to use “assigned” or “increment” instead. Note you might not have that problem in your project but that was preventing me from […]

Posted in db | Tagged hibernate, java, mysql, oracle | Leave a response

How can I pad a String in Java?

By Chris on September 16, 2013

I’ve stumbled upon that problem recently and couldn’t remember how to do it.  Has you except it’s trivial to do and like most of what can be done in programming there more than one way to do it. 1- Good old jdk String 🙂 Since Java 1.5 you have the new String format method do […]

Posted in tips | Tagged Apache, format, Guava, java, String, StringUtils | Leave a response

How to synchronize a List in java ? A Vector vs ArrayList Showdown !

By Chris on September 5, 2013

They’re always a question that comeback either in interview or when you are playing old code. Why the hell are they using Vector over arrayList ? Vector is a class that exists since the beginning of java (aka Java 1.0) it’s implement List. It seems to pollute old code and still use programmer that don’t […]

Posted in prog, tips | Tagged arraylist, collections, java, java.util.List, List, synchronization, synchronizedList, vector | Leave a response

Tags

4hww 2018 about addiction arraylist book ClassLoaders date dating db deployment DeploymentException errors hibernate icon ideas j2ee java java.util.List jboss linux List memory motivation mysql netstat oracle port programing quora rest reviews self help soap sql star startup String struts struts tag styleClass tags to_date welcome windows

Recent Comments

  • kevin on Oracle have no Boolean, how to fix this

Calendar

January 2021
MonTueWedThuFriSatSun
« May  
 123
45678910
11121314151617
18192021222324
25262728293031

Archives

  • May 2020
  • January 2019
  • December 2018
  • July 2018
  • April 2018
  • January 2018
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • November 2013
  • September 2013
  • August 2013
  • July 2013

Copyright © 2021 Some Trials & a lot of Errors.

Powered by WordPress and Hybrid.