Repast Does not display background Maps in example files - gis

I am brand new to Repast and am interested in eventually creating a marine traffic simulation in the Arctic. I am going through the "Import Repast Examples" and none of the models I go through display the maps in the simulation display. For example this shot of the Geotracks demo shows the blue marble map is clearly not loading.
In the Geography demo a small thumbnail of Chicago is visible but none of the surrounding map.
I couldn't find any documentation to fix this issue. When I go to the GIS display setup it appears the files are enabled so I do not known what else to do to troubleshoot.
Here is a picture of the console errors that I am receiving.
I installed Repast using the default installation settings for Windows.

I am able to replicate the issue. The background map layers are provided by the NASA WorldWind service and it appears that the servers are sometimes slow or unresponsive. This data is served by third parties and the Repast team does not have direct control over providing the background map layers. There does appear to be a solution as posted by one of their developers here: https://github.com/NASAWorldWind/WorldWindJava/issues/219 in which they describe how to improve some of the WorldWind network properties to help with the slow servers, and I have tested that this does work.
You will need to copy the below into a file named "worldwind.xml" in your project:
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2006-2009, 2017, 2020 United States Government, as represented by the
~ Administrator of the National Aeronautics and Space Administration.
~ All rights reserved.
~
~ The NASA World Wind Java (WWJ) platform is licensed under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software distributed
~ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
~ CONDITIONS OF ANY KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations under the License.
~
~ NASA World Wind Java (WWJ) also contains the following 3rd party Open Source
~ software:
~
~ Jackson Parser – Licensed under Apache 2.0
~ GDAL – Licensed under MIT
~ JOGL – Licensed under Berkeley Software Distribution (BSD)
~ Gluegen – Licensed under Berkeley Software Distribution (BSD)
~
~ A complete listing of 3rd Party software notices and licenses included in
~ NASA World Wind Java (WWJ) can be found in the WorldWindJava-v2.2 3rd-party
~ notices and licenses PDF found in code directory.
-->
<!--$Id: worldwind.xml 2348 2014-09-25 23:35:46Z dcollins $-->
<!--Default WorldWind configuration values-->
<!--Any of these can be overridden by specifying an application configuration document-->
<!--An alternate document to this one can also be specified-->
<!--See the javadoc for the Configuration class for details-->
<WorldWindConfiguration version="1">
<!--The initial layer list can be embedded here or linked as below. To change the set of initial layers,-->
<!--modify the file identified by the href or replace the link with your own-->
<LayerList href="config/worldwind.layers.xml"/>
<!--Most configuration information is defined in attribute-value pairs-->
<Property name="gov.nasa.worldwind.avkey.ModelClassName" value="gov.nasa.worldwind.BasicModel"/>
<Property name="gov.nasa.worldwind.avkey.GlobeClassName"
value="gov.nasa.worldwind.globes.Earth"/>
<Property name="gov.nasa.worldwind.avkey.EarthElevationModelConfigFile"
value="config/Earth/EarthElevations2.xml"/>
<Property name="gov.nasa.worldwind.globes.GeographicProjectionClassName"
value="gov.nasa.worldwind.globes.projections.ProjectionEquirectangular"/>
<Property name="gov.nasa.worldwind.avkey.InitialLatitude" value="38"/>
<Property name="gov.nasa.worldwind.avkey.InitialAltitude" value="19.07e6"/>
<Property name="gov.nasa.worldwind.avkey.ViewClassName" value="gov.nasa.worldwind.view.orbit.BasicOrbitView"/>
<Property name="gov.nasa.worldwind.avkey.ViewInputHandlerClassName"
value="gov.nasa.worldwind.view.orbit.OrbitViewInputHandler"/>
<Property name="gov.nasa.worldwind.avkey.InputHandlerClassName" value="gov.nasa.worldwind.awt.AWTInputHandler"/>
<Property name="gov.nasa.worldwind.avkey.LoggerName" value="gov.nasa.worldwind"/>
<Property name="gov.nasa.worldwind.avkey.WorldWindowClassName"
value="gov.nasa.worldwind.WorldWindowGLAutoDrawable"/>
<Property name="gov.nasa.worldwind.avkey.ElevationModelFactory"
value="gov.nasa.worldwind.terrain.BasicElevationModelFactory"/>
<Property name="gov.nasa.worldwind.avkey.LayerFactory" value="gov.nasa.worldwind.layers.BasicLayerFactory"/>
<Property name="gov.nasa.worldwind.avkey.ShapefileLayerFactory"
value="gov.nasa.worldwind.formats.shapefile.ShapefileLayerFactory"/>
<Property name="gov.nasa.worldwind.avkey.WebViewFactory"
value="gov.nasa.worldwind.util.webview.BasicWebViewFactory"/>
<Property name="gov.nasa.worldwind.avkey.TessellatorClassName"
value="gov.nasa.worldwind.terrain.RectangularTessellator"/>
<Property name="gov.nasa.worldwind.avkey.MemoryCacheSetClassName"
value="gov.nasa.worldwind.cache.BasicMemoryCacheSet"/>
<Property name="gov.nasa.worldwind.avkey.SessionCacheClassName" value="gov.nasa.worldwind.cache.BasicSessionCache"/>
<Property name="gov.nasa.worldwind.avkey.RetrievalServiceClassName"
value="gov.nasa.worldwind.retrieve.BasicRetrievalService"/>
<Property name="gov.nasa.worldwind.avkey.SceneControllerClassName"
value="gov.nasa.worldwind.StereoOptionSceneController"/>
<Property name="gov.nasa.worldwind.avkey.NetworkStatusClassName"
value="gov.nasa.worldwind.util.BasicNetworkStatus"/>
<Property name="gov.nasa.worldwind.render.PointPlacemarkAttributes.DefaultImagePath"
value="images/pushpins/plain-yellow.png"/>
<Property name="gov.nasa.worldwind.render.PointPlacemarkAttributes.DefaultLabelFont"
value="Arial-BOLD-14"/>
<!-- The following lists the sites to test for public network access. Specify an empty string, "", for no sites.-->
<!-- Don't specify the property at all to use the default list. -->
<Property name="gov.nasa.worldwind.avkey.NetworkStatusTestSites"
value="www.nasa.gov, worldwind.arc.nasa.gov, google.com, microsoft.com, yahoo.com"/>
<Property name="gov.nasa.worldwind.avkey.TaskServiceClassName" value="gov.nasa.worldwind.util.ThreadedTaskService"/>
<Property name="gov.nasa.worldwind.avkey.DataFileStoreClassName"
value="gov.nasa.worldwind.cache.BasicDataFileStore"/>
<Property name="gov.nasa.worldwind.avkey.DataRasterReaderFactoryClassName"
value="gov.nasa.worldwind.data.BasicDataRasterReaderFactory"/>
<Property name="gov.nasa.worldwind.avkey.DataFileStoreConfigurationFileName" value="config/DataFileStore.xml"/>
<Property name="gov.nasa.worldwind.avkey.WorldMapImagePath" value="images/earth-map-512x256.dds"/>
<Property name="gov.nasa.worldwind.StarsLayer.StarsFileName" value="config/Hipparcos_Stars_Mag6x5044.dat"/>
<!--The following are tuning parameters for various WorldWind internals-->
<Property name="gov.nasa.worldwind.avkey.RetrievalPoolSize" value="32"/>
<Property name="gov.nasa.worldwind.avkey.RetrievalQueueSize" value="400"/>
<Property name="gov.nasa.worldwind.avkey.RetrievalStaleRequestLimit" value="60000"/>
<Property name="gov.nasa.worldwind.avkey.TaskPoolSize" value="32"/>
<Property name="gov.nasa.worldwind.avkey.TaskQueueSize" value="60"/>
<Property name="gov.nasa.worldwind.avkey.ScheduledTaskPoolSize" value="1"/>
<Property name="gov.nasa.worldwind.avkey.VerticalExaggeration" value="1"/>
<Property name="gov.nasa.worldwind.avkey.URLConnectTimeout" value="8000"/>
<Property name="gov.nasa.worldwind.avkey.URLReadTimeout" value="10000"/>
<Property name="gov.nasa.worldwind.avkey.TextureCacheSize" value="500000000"/>
<Property name="gov.nasa.worldwind.avkey.ElevationTileCacheSize" value="20000000"/>
<Property name="gov.nasa.worldwind.avkey.ElevationExtremesLookupCacheSize" value="20000000"/>
<Property name="gov.nasa.worldwind.avkey.SectorGeometryCacheSize" value="10000000"/>
<Property name="gov.nasa.worldwind.avkey.TextureTileCacheSize" value="10000000"/>
<Property name="gov.nasa.worldwind.avkey.PlacenameLayerCacheSize" value="4000000"/>
<Property name="gov.nasa.worldwind.avkey.AirspaceGeometryCacheSize" value="32000000"/>
<Property name="gov.nasa.worldwind.avkey.VBOUsage" value="true"/>
<Property name="gov.nasa.worldwind.avkey.VBOThreshold" value="30"/>
<Property name="gov.nasa.worldwind.avkey.OfflineMode" value="false"/>
<Property name="gov.nasa.worldwind.avkey.RectangularTessellatorMaxLevel" value="30"/>
<Property name="gov.nasa.worldwind.StereoFocusAngle" value="1.6"/>
<Property name="gov.nasa.worldwind.avkey.ForceRedrawOnMousePressed" value="f"/>
<!-- Here's one way to specify proxy settings -->
<!--<Property name="gov.nasa.worldwind.avkey.UrlProxyHost" value="100.215.10.20"/>-->
<!--<Property name="gov.nasa.worldwind.avkey.UrlProxyPort" value="8080"/>-->
<!--<Property name="gov.nasa.worldwind.avkey.UrlProxyType" value="Proxy.Type.Http"/>-->
<!-- Location of icons for MIL-STD-2525C symbol set. This can be a URL to a web server, to a local zip or jar archive.
See https://goworldwind.org/developers-guide/symbology/tactical-symbols/#offline-use for more information on how
to configure a local symbol repository.
Examples: http://myserver.com/milstd2525/ (web server)
jar:file:milstd2525-symbols.zip! (local zip archive) -->
<Property name="gov.nasa.worldwind.avkey.MilStd2525IconRetrieverPath"
value="https://worldwind.arc.nasa.gov/milstd2525c/rev1/"/>
</WorldWindConfiguration>
For testing with the Repast Geography demo, I placed the worldwind.xml file in the geograph.styles folder. And then in the ContextCreator.java add the following:
static
{
System.setProperty("gov.nasa.worldwind.app.config.document",
"geography/styles/worldwind.xml");
}
This will tell WorldWind where to find the modified worldwind.xml file. You will need to repeat this process for any other Repast model that uses the background NASA layers. Apologies for this clunky workaround. We will fix this in the next Repast release so that you don't need to manually perform these changes.

Related

Read CSV file line by line in WSO2 ESB 5.0 using Smooks

I have a CSV File that I am reading via VFS. After reading the file, I am using Smooks to convert the CSV data into XML and then sending it to another proxy.
By default configuration, smooks converts the whole message into one xml payload.
Problem:
The default method is okay for small files, but I have a very large file to process and I want that I can read the file line by line and then send the message to the next component.
Proxy Configuration:
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="ParseTestCSV1"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="vfs">
<target>
<inSequence>
<log level="full" separator="*********Parsing Prroxy Started*****"/>
<smooks config-key="gov:/repository/csv/smooks-config.xml">
<input type="text"/>
<output type="xml"/>
</smooks>
<log level="full" separator="********After Smooks*******"/>
<property name="OUT_ONLY" value="true"/>
<property action="remove" name="ClientApiNonBlocking" scope="axis2"/>
<call/>
<log level="full" separator="*******Message Sent*********"/>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
<parameter name="transport.PollInterval">60</parameter>
<parameter name="transport.vfs.FileURI">vfs:file://C:\WSO2EnterpriseIntegrator\file\In</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.MoveAfterFailure">vfs:file://C:\WSO2EnterpriseIntegrator\file\Fail</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="transport.vfs.FileNamePattern">convert.*.csv</parameter>
<parameter name="transport.vfs.MoveAfterProcess">vfs:file://C:\WSO2EnterpriseIntegrator\file\Out</parameter>
<description/>
</proxy>
Smooks Configuration File:
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd">
<resource-config selector="org.xml.sax.driver">
<resource>org.milyn.csv.CSVReader</resource>
<param name="fields">$ignore$,firstname,lastname,age,street,address,statecode,postalcode,amount,code,date</param>
<param name="rootElementName">record</param>
<param name="recordElementName">csvRecord</param>
</resource-config>
</smooks-resource-list>
How can I transform my Smook's configuration file to read one line and then send it forward. Any insight would be appreciated.
I've had a similar case, where I had to split a huge XML into a jms message for each order in the XML. You can achive this by using freemaker templates.
Basically you define your freemarker template and bind it to a router.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2005-2010, WSO2 Inc. (http://wso2.com) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:core="http://www.milyn.org/xsd/smooks/smooks-core-1.3.xsd"
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
xmlns:file="http://www.milyn.org/xsd/smooks/file-routing-1.1.xsd"
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"
xmlns:jms="http://www.milyn.org/xsd/smooks/jms-routing-1.2.xsd">
<core:namespaces>
<core:namespace prefix="soapenv" uri="http://schemas.xmlsoap.org/soap/envelope/"/>
</core:namespaces>
<core:filterSettings type="SAX" />
<jb:bean beanId="recordsAsXml" class="java.util.Hashtable" createOnElement="records">
<jb:value data="records/Id" decoder="String" property="Id"></jb:value>
<jb:value data="records/Account_ID__c" decoder="String" property="accountID"></jb:value>
<!-- ...-->
</jb:bean>
<ftl:freemarker applyOnElement="records">
<!--<ftl:template>/repository/resources/smooks/record_as_xml.ftl</ftl:template>-->
<ftl:template><!--<order>
<id>${recordsAsXml.Id}</id>
<accountId>${recordsAsXml.accountID}</accountId>
<!-- ...-->
</order>-->
</ftl:template>
<ftl:use>
<ftl:bindTo id="recordAsXmlOutput"/>
</ftl:use>
</ftl:freemarker>
<jms:router routeOnElement="records" beanId="recordAsXmlOutput" destination="MyJMSQueue">
<jms:message>
</jms:message>
<jms:jndi properties="/repository/resources/smooks/activemq.sr.jndi.properties" />
<jms:highWaterMark mark="-1"/>
</jms:router>
</smooks-resource-list>
The following article might also help.
Message processing with smooks

Native query executeUpdate seems to commit data in Spring transaction

my usecase is following:
When creating an application user (EntityManager.persist) I also have to create a DB user and grant him privileges (that's why I need hibernate nativeQuery).
I have a Spring #Transactional method which calls my DAO with both calls:
#Transactional
public Integer createCompany(Company company) throws Exception {
companyDao.createReportUser(ReportUser user);
...
}
My DAO method looks like this:
getEm().persist(companyReportsUser);
getEm().createNativeQuery("CREATE USER user1#localhost IDENTIFIED BY :password").setParameter("password", password).executeUpdate();
getEm().createNativeQuery("GRANT SELECT ON appdb.v_company TO user1#localhost").executeUpdate();
//several grants
Now, as soon as the first line with executeUpdate() is executed I can see persisted companyReportsUser in database along with DB user (user1#localhost).
All the nativeQueries are executed and immediately commited one by one. Since they are commited, they cannot be rolled back.
There is no auto-commit parameter set anywhere in my configuration so I assume it is 'false' as found in Hibernate docs.
I've tested #Transactional behavior without native queries and it works as supposed to (transaction is rolled back when I throw an RuntimeException and no data are inserted to database)
When debugging I've seen that persist operation delays execution when it is invoked in a running transaction.
Native query seems to create and execute a PreparedStatement immediately (at least I didn't find a queue of any kind.
I suppose that I might not get the interaction between hibernate native query and Spring transaction, but I've took my time reading Spring and Hibernate docs regarding transactions and native queries and did not found anything that would help me.
Maybe there is a better way to create a database user and grant privileges than native queries (although I didn't find any)
Below is my application config:
applicationContext.xml
<tx:annotation-driven transaction-manager="txManager" />
<bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory">
<ref local="entityManagerFactory" />
</property>
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="persistenceUnitName" value="domainPU" />
<property name="loadTimeWeaver">
<bean
class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
</property>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
</property>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="${db.url}" />
<property name="username" value="${db.user.name}" />
<property name="password" value="${db.user.password}" />
<property name="validationQuery" value="select 1 as dbcp_connection_test" />
<property name="testOnBorrow" value="true" />
</bean>
persistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
<persistence-unit name="domainPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.domain.Entity1</class>
....
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.jdbc.batch_size" value="100"></property>
<property name="hibernate.order_inserts" value="true"></property>
<property name="hibernate.order_updates" value="true"></property>
<property name="hibernate.c3p0.min_size" value="5"></property>
<property name="hibernate.c3p0.max_size" value="30"></property>
<property name="hibernate.c3p0.timeout" value="300"></property>
<property name="hibernate.c3p0.max_statements" value="100"></property>
<property name="hibernate.c3p0.idle_test_period" value="${hibernate.c3p0.idle_test_period}"></property>
</properties>
</persistence-unit>
Libraries used:
Hibernate 4.1.6.FINAL
Spring 3.2.2.RELEASE
mysql-connector-java-5.1.21
MySQL 5.5
After digging deeper into how transactions work in MySQL I found an answer:
Problem was in the specific statements inside the native sql query.
From MySQL documentation:
13.3.3 Statements That Cause an Implicit Commit
Data definition language (DDL) statements that define or modify database objects (...CREATE TABLE, DROP DATABASE...)
Statements that implicitly use or modify tables in the mysql database (CREATE USER, DROP USER, and RENAME USER..., GRANT, REVOKE, ...)
...
More details here:
http://dev.mysql.com/doc/refman/5.1/en/implicit-commit.html
I've decided to split that action into two parts:
ordinary hibernate statements (inside a transaction),
native query statements
and supply user with a tool/action to reinvoke the second part in case when something goes wrong.
Other solution would be migrating to some other RDBMS that supports transactions around DDL operations.

Issue upgrading from Jackson 1.9 to 2.5 using Spring 3.1.2 - ProviderBase class not found

I'm trying to upgrade a current project from Jackson 1.9 to 2.5. Everything was going well until I tried to startup my WAS 7 server and receive this error:
org.springframework.beans.factory.CannotLoadBeanClassException: Error
loading class
[com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider] for bean
with name 'jaxbProvider' defined in ServletContext resource
[/WEB-INF/spring/applicationContext-configuration.xml]: problem with
class file or dependent class; nested exception is
java.lang.NoClassDefFoundError:
com.fasterxml.jackson.jaxrs.base.ProviderBase
This appears to be in relation to trying to register the Jackson Provider in my web.xml below:
<!-- Jackson Provider -->
<bean id="jaxbProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider" >
<property name="mapper" ref="jacksonObjectMapper"/>
</bean>
<bean id="jacksonObjectMapper" class="com.fasterxml.jackson.databind.ObjectMapper" >
<property name="annotationIntrospector" ref="jacksonAnnotationIntrospector"></property>
</bean>
<bean id="jacksonAnnotationIntrospector" class="com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair" >
<constructor-arg ref="primaryAnnotationIntrospector" />
<constructor-arg ref="secondaryAnnotationIntrospector" />
</bean>
<bean id="primaryAnnotationIntrospector" class="com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector" />
<bean id="secondaryAnnotationIntrospector" class="com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector" />
I have the following jars on my classpath:
jackson-annotations-2.5.0.jar
jackson-core-2.5.0.jar
jackson-databind-2.5.0.jar
jackson-jaxrs-json-provider-2.5.0.jar
jackson-module-jaxb-annotations.2.5.0.jar
Now from my understanding its looking for this fellow:
com.fasterxml.jackson.jaxrs.base.ProviderBase
but can't find it. A google search reveals that class as belonging to a
jackson-jaxrs-provider project, but I can't find a specific jar for that. I think that's because that is just a base for the jackson-jaxrs-json-provider.2.5.0.jar that I already included. So shouldn't it inherently be able to see that base class through the jackson-jaxrs-json-provider.2.5.0.jar??
If anyone has an idea of what could be wrong I would be very appreciative!
Thanks.
If you used Maven, adding jackson-jaxrs-json-provider as a dependency, you will see all the following pulled in
(I had an image from another post with v2.2.3- disregard the version)
As you can see, it does depend on a jackson-jaxrs-base, which is where the ProviderBase is located.
You can download it here (just click the 2.5.0, then the Download Bundle)

Japanese characters cannot be seen in Spring Batch Admin UI

Japanese characters cannot be seen in Spring Batch Admin UI.
My code is as the following:
public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {
stepContribution.setExitStatus(new ExitStatus("SKIPPED", "例パラメータ does not exist."));
}
But it displayed Exit Message as the following:
How can I do to display the japanese characters in Spring Batch Admin UI??
I used SpringBatchAdmin 1.0.0.
When I set the UTF-8 encoding in freemarker template, Japanese character can be shown in Spring Batch Admin UI.
There are 2 ways to solve the problem:
Using SpringBatchAdmin 1.2.2 and above because I found that the problem had already fixed on SpringBatchAdmin 1.2.2.
Overriding the resources-context.xml under /META-INF/spring/batch/servlet/resources/ of spring-batch-admin-resources-1.0.0.RELEASE.jar
Since the first way is not ok for me, I use the second way.
I create an xml file under /META-INF/spring/batch/servlet/override/ to override the resources-context.xml.
I add the contentType property in standard bean.
Here is the snippet of newly created xml file:
<bean id="standard" parent="parentLayout">
<property name="url" value="/layouts/standard.ftl" />
<property name="contentType" value="text/html;charset=UTF-8" />
<property name="attributes">
<props merge="true">
<prop key="body">/layouts/home.ftl</prop>
<!-- Matches the prefix of the servlet mapping in web.xml -->
<prop key="servletPath">#{resourceService.servletPath}</prop>
</props>
</property>
</bean>
Hope this will help the others also. :)

How to show differences between entities and database table structure

I am currently working on a system that has been around for a number of years and has gone through a fair amount of transformation. (GWT\Spring\Hibernate). I recently had to merge two entities as part of a change. When I looked at the actual sql tables I noticed that there were a number of orphaned columns that were actually not mapped to the entities and could effectively be dropped. I was wondering if there are any tools out there that would help us to identify and strip out outdated columns which are not actually being linked to our entities.
If you´re Using Spring and hibernate you can use autodetection to create/update database though the entities attributes that you have in your entity.
your hibernate.hbm2ddl.auto setting should be defining that the database is created (options are validate, create, update or create-drop)
Here the Spring configuration:
<?xml version="1.0" encoding="UTF-8"?>
<persistence-unit name="NewPersistenceUnit">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/Icarus"/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.username" value="root"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.archive.autodetection" value="class"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hbm2ddl.auto" value="create"/>
</properties>
<class>net.interaxia.icarus.data.models.ServerNode</class>
</persistence-unit>