Skip to content

Instantly share code, notes, and snippets.

View ptahchiev's full-sized avatar

Petar Tahchiev ptahchiev

View GitHub Profile
@ptahchiev
ptahchiev / gist:322344acc453c23f4baa
Created April 1, 2015 16:50
CustomConverionSerice - no compiler warnings :)
@Override
public <SOURCE, TARGET> Collection<TARGET> convert(Collection<SOURCE> sources, Class<TARGET> targetClass) {
final List<TARGET> result = new ArrayList<>();
if (sources != null) {
for (SOURCE source : sources) {
result.add(super.convert(source, targetClass));
}
}
@ptahchiev
ptahchiev / gist:247a4a17ffee16a98705d11de920389b
Last active July 25, 2016 11:56
Moneta Exception with a Job
2016-07-25 14:50:00,154 org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler [defaultTaskScheduler-1] ERROR: Unexpected error occurred in scheduled task.
UnknownCurrencyException [currencyCode=KRW]
at javax.money.spi.MonetaryCurrenciesSingletonSpi.getCurrency(MonetaryCurrenciesSingletonSpi.java:74)
at javax.money.Monetary.getCurrency(Monetary.java:422)
at org.jadira.usertype.moneyandcurrency.moneta.columnmapper.StringColumnCurrencyUnitMapper.fromNonNullValue(StringColumnCurrencyUnitMapper.java:29)
at org.jadira.usertype.moneyandcurrency.moneta.columnmapper.StringColumnCurrencyUnitMapper.fromNonNullValue(StringColumnCurrencyUnitMapper.java:23)
at org.jadira.usertype.spi.shared.AbstractSingleColumnUserType.nullSafeGet(AbstractSingleColumnUserType.java:76)
at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:111)
at org.hibernate.persister.collection.AbstractCollectionPersister.readElement(AbstractCollectionPersister.java:833)
at org.hibernate.collection.internal.PersistentSet.rea
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mappingJackson2HttpMessageConverter' defined in class path resource [org/springframework/boot/autoconfigure/web/JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration.class]: Unsatisfied dependency expressed through method 'mappingJackson2HttpMessageConverter' parameter 0: Error creating bean with name 'objectMapper' defined in class path resource [org/springframework/boot/autoconfigure/data/rest/SpringBootRepositoryRestMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fasterxml.jackson.databind.ObjectMapper]: Circular reference involving containing bean 'org.springframework.boot.autoconfigure.data.rest.SpringBootRepositoryRestMvcConfiguration' - consider declaring the factory method as static for independence from its containing instance. Factory
petar@petar-XPS-15-9550:~/workspace/nemesis-archetype-master/storefront$ mvn nemesis:update-db -Dprofiles=h2
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Samplestore Storefront 1.2.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> nemesis-maven-plugin:1.2.0.BUILD-SNAPSHOT:update-db (default-cli) > compile @ samplestore-storefront >>>
Downloading: https://maven.oracle.com/com/paypal/sdk/paypal-core/maven-metadata.xml
Downloading: https://maven.oracle.com/org/webjars/bower/jquery/maven-metadata.xml
<div id="change-store" class="popup store-selector">
<div class="head">
<h2>Pickup in store</h2>
</div>
<div class="body">
<form>
<input type="text" name="" value="1 Freeport Village Statio Space 355E mFreeport , ME 04032.." />
<button type="submit" class="big-button">find stores</button>
</form>
public class Sample2 {
public static void main(String[] args) {
int number = 17;
System.out.println(imperative(number));
System.out.println(declarative(number));
}
public static boolean imperative(int number) {
13:05:00
2017-02-10 13:05:00,431 com.blackbetty.webshop.storefront.controllers.passwordreset.PasswordResetViewController [http-nio-8111-exec-10] ERROR: The field [code] cannot be empty
13:05:23
2017-02-10 13:05:23,130 com.blackbetty.webshop.storefront.controllers.passwordreset.PasswordResetViewController [http-nio-8111-exec-1] ERROR: Cannot find CustomerEntity for code: mamatez65@gmail.com
14:00:00
2017-02-10 14:00:00,101 org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler [defaultTaskScheduler-1] ERROR: Unexpected error occurred in scheduled task.
petar@petar-XPS-15-9550:~/workspace/nemesis-console-v2$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Nemesis Consoles 1.5.1.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ nemesis-console-v2 ---
[INFO] Deleting /home/petar/workspace/nemesis-console-v2/target
[INFO]
[ {
"id" : "core",
"text" : "core",
"children" : [ {
"id" : "catalogfolder",
"text" : "catalogfolder",
"children" : [ {
"id" : "category",
"text" : "category",
"iconCls" : "category",
@ptahchiev
ptahchiev / dump1.log
Created December 13, 2017 20:26
after-kill-before-shutdown
2017-12-13 22:22:14
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.151-b12 mixed mode):
"Attach Listener" #245 daemon prio=9 os_prio=0 tid=0x00007fc0d000f000 nid=0x2a30 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"SIGTERM handler" #244 daemon prio=9 os_prio=0 tid=0x00007fc0d000e000 nid=0x29ce waiting for monitor entry [0x00007fc0630e3000]
java.lang.Thread.State: BLOCKED (on object monitor)
at java.lang.Shutdown.exit(Shutdown.java:212)
- waiting to lock <0x00000000c028b258> (a java.lang.Class for java.lang.Shutdown)