Flyway Future State prevents new migration - java

I'm trying the Java Migration tutorial. After modifying a migrated Java class, the Java class got stuck in Future state and prevented new migration. I'm new with Flyway and not sure where I did wrong. Or is there any known issue with Future state?
I first added two SQL files and ran mvn flyway:migrate. Both files are migrated successfully. Then added a Java class V3__Anonymize, ran mvn flyway:migrate again. It's successful too. The info command shows
+-----------+--------+---------------------+------+---------------------+---------+
| Category | Version| Description | Type | Installed On | State |
+-----------+--------+---------------------+------+---------------------+---------+
| Versioned | 1 | Create person table | SQL | 2022-11-03 08:26:52 | Success |
| Versioned | 2 | Add people | SQL | 2022-11-03 08:28:45 | Success |
| Versioned | 3 | Anonymize | JDBC | 2022-11-03 09:05:29 | Success |
+-----------+--------+---------------------+------+---------------------+---------+
Then I modified V3__Anonymize class, adding just a line to migrate function for System.out.println("something"). The info commands show this third job with a Future state:
+-----------+--------+---------------------+------+---------------------+---------+
| Category | Version| Description | Type | Installed On | State |
+-----------+--------+---------------------+------+---------------------+---------+
| Versioned | 1 | Create person table | SQL | 2022-11-03 08:26:52 | Success |
| Versioned | 2 | Add people | SQL | 2022-11-03 08:28:45 | Success |
| Versioned | 3 | Anonymize | JDBC | 2022-11-03 09:05:29 | Future | +-----------+--------+---------------------+------+---------------------+---------+
Then ran mvn flyway:migrate, and it gave a WARNING shown below.
[INFO] --- flyway-maven-plugin:9.7.0:migrate (default-cli) # my-migration-service ---
[INFO] Flyway Community Edition 9.7.0 by Redgate
[INFO] See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#9.7.0
[INFO]
[INFO] Database: jdbc:h2:file:./target/foobar (H2 2.1)
[INFO] Successfully validated 3 migrations (execution time 00:00.020s)
[INFO] Current version of schema "PUBLIC": 3
[WARNING] Schema "PUBLIC" has a version (3) that is newer than the latest available migration (2) !
[INFO] Schema "PUBLIC" is up to date. No migration necessary.
I tried to run mvn compile, then mvn flyway:migrate, mvn flyway:info, but I still got the same WARNING and the third job stays in Future state.
I also added a new Java class V4__Add_another_person, then ran mvn compile, mvn flyway:migrate, but no change to the state of the third job. The new job isn't added to flyway:info output.
Then ran mvn flyway:migrate, and it gave a WARNING shown below.

Once you run a migration, you shouldn't touch any more its script. Here it was identified you did it, as the checksum is different. As long as this code is not pushed to the master branch (and someone run migration), you can remove the latest line from flyway_schema_history and then migrate again.

Related

dspace create-administrator fails

I am working on installing the dspace 6.1 src release. I am on Suse 12.2. I have followed the installation instructions carefully, followed the ideas in this post, and cleaned-reinstalled-retried the create-administrator script and the user script numerous times yesterday and today. I always get the same error:
dspace#mycomputer:~/dspace_install> bin/dspace create-administrator
Exception: The schema validator returned: Unable to create requested
service [org.hibernate.engine.spi.CacheImplementor]
org.dspace.core.exception.DatabaseSchemaValidationException: The
schema validator returned: Unable to create requested service
[org.hibernate.engine.spi.CacheImplementor]
at org.dspace.core.Context.init(Context.java:170)
at org.dspace.core.Context.<init>(Context.java:126)
at org.dspace.administer.CreateAdministrator.<init>
(CreateAdministrator.java:101)
at (org.dspace.administer.CreateAdministrator.main(CreateAdministrator.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
I have not found this error anywhere online. The closest is that posting from 2015 above. My database did not have default entries in the epersongroup table, so I added the entries suggested the post above (add 'Anonymous' and 'Administrator' groups). Still I am getting the same error.
I would be grateful for any help!
Since the error reports an issue with the database schema, I recommend the following.
Run the following command to see the status of your database schema
bin/dspace database info
You will see output like the following
+----------------+-----------------------------------------------------+---------------------+---------+
| Version | Description | Installed on | State |
+----------------+-----------------------------------------------------+---------------------+---------+
| 1 | << Flyway Baseline >> | 2017-07-25 18:26:49 | Baselin |
| 1.1 | Initial DSpace 1.1 database schema | 2017-07-25 18:26:50 | Success |
| 1.2 | Upgrade to DSpace 1.2 schema | 2017-07-25 18:26:50 | Success |
| 1.3 | Upgrade to DSpace 1.3 schema | 2017-07-25 18:26:50 | Success |
| 1.3.9 | Drop constraint for DSpace 1 4 schema | 2017-07-25 18:26:50 | Success |
| 1.4 | Upgrade to DSpace 1.4 schema | 2017-07-25 18:26:50 | Success |
| 1.5 | Upgrade to DSpace 1.5 schema | 2017-07-25 18:26:51 | Success |
| 1.5.9 | Drop constraint for DSpace 1 6 schema | 2017-07-25 18:26:51 | Success |
| 1.6 | Upgrade to DSpace 1.6 schema | 2017-07-25 18:26:51 | Success |
| 1.7 | Upgrade to DSpace 1.7 schema | 2017-07-25 18:26:51 | Success |
| 1.8 | Upgrade to DSpace 1.8 schema | 2017-07-25 18:26:51 | Success |
| 3.0 | Upgrade to DSpace 3.x schema | 2017-07-25 18:26:51 | Success |
| 4.0 | Upgrade to DSpace 4.x schema | 2017-07-25 18:26:51 | Success |
| 4.9.2015.10.26 | DS-2818 registry update | 2017-07-25 18:26:51 | Success |
| 5.0.2014.08.08 | DS-1945 Helpdesk Request a Copy | 2017-07-25 18:26:51 | Success |
| 5.0.2014.09.25 | DS 1582 Metadata For All Objects drop constraint | 2017-07-25 18:26:51 | Success |
| 5.0.2014.09.26 | DS-1582 Metadata For All Objects | 2017-07-25 18:26:51 | Success |
| 5.6.2016.08.23 | DS-3097 | 2017-07-25 18:26:51 | Success |
| 5.7.2017.04.11 | DS-3563 Index metadatavalue resource type id column | 2017-07-25 18:26:51 | Success |
| 5.7.2017.05.05 | DS 3431 Add Policies for BasicWorkflow | 2017-07-25 18:26:51 | Success |
| 6.0.2015.03.06 | DS 2701 Dso Uuid Migration | 2017-07-25 18:26:51 | Success |
| 6.0.2015.03.07 | DS-2701 Hibernate migration | 2017-07-25 18:26:51 | Success |
| 6.0.2015.08.31 | DS 2701 Hibernate Workflow Migration | 2017-07-25 18:26:52 | Success |
| 6.0.2016.01.03 | DS-3024 | 2017-07-25 18:26:52 | Success |
| 6.0.2016.01.26 | DS 2188 Remove DBMS Browse Tables | 2017-07-25 18:26:52 | Success |
| 6.0.2016.02.25 | DS-3004-slow-searching-as-admin | 2017-07-25 18:26:52 | Success |
| 6.0.2016.04.01 | DS-1955 Increase embargo reason | 2017-07-25 18:26:52 | Success |
| 6.0.2016.04.04 | DS-3086-OAI-Performance-fix | 2017-07-25 18:26:52 | Success |
| 6.0.2016.04.14 | DS-3125-fix-bundle-bitstream-delete-rights | 2017-07-25 18:26:52 | Success |
| 6.0.2016.05.10 | DS-3168-fix-requestitem item id column | 2017-07-25 18:26:52 | Success |
| 6.0.2016.07.21 | DS-2775 | 2017-07-25 18:26:52 | Success |
| 6.0.2016.07.26 | DS-3277 fix handle assignment | 2017-07-25 18:26:52 | Success |
| 6.0.2016.08.23 | DS-3097 | 2017-07-25 18:26:52 | Success |
| 6.1.2017.01.03 | DS 3431 Add Policies for BasicWorkflow | 2017-07-25 18:26:52 | Success |
+----------------+-----------------------------------------------------+---------------------+---------+
If you see any items without a status of "Success" run the following
bin/dspace database repair
If you do not see that the entries include release 6.1, run the following command
bin/dspace database migrate
Hopefully this will resolve this issue.
I just spoke with my colleague, who found the real problem. We installed 2 instances of Dspace on the same server, and he found the setting for the hibernate ehcache (hibernate-ehcache-config.xml) in the [dspace-src]/dspace/config directory. This was referenced in the exception message I posted in my question above. There is a warning in hibernate-ehcache-config.xml that when you have more than one instance of dspace on the same server, you need separate diskStore folders for the hibernate ehcache. I created a separate one for my Dspace instance, then reversed my setting for dspace.hostname in the local.cfg file so it shows the server domain name, and everything works, the server, and create-administrator on the command line.

Feature / bundle list for JPA [2.1] for Karaf

I'm trying to migrate project from Eclipse OSGi runtime environment to Karaf, and I prepare install script for depenendecies. It is quite a hard way, for example, transaction API requires javax.enterprise.cdi-api, and this requires
javax.el,version=3.0.0 from javax.el-api (6)
javax.inject,version=1.0.0 from com.eclipsesource.jaxrs.jersey-all (59)
javax.interceptor,version=1.2.0 from javax.interceptor-api (48)
For sure, I'm not the first and last person to go that way. Are there any ready features / bundle lists / install scripts which I could use for the process? And how / where to search for them?
Searching for "JPA 2.1 feature for Karaf" returns me the list of posts with problems people have building their feature list... no ready solutions...
I'm working on Apache ServiceMix 7.0.0 and I have a JPA 2.3.0 feature which is available.
Features list
karaf#root>feature:list | grep jpa
deltaspike-jpa | 1.2.1 | | Uninstalled | org.ops4j.pax.cdi-0.12.0 | Apache Deltaspike jpa support
camel-jpa | 2.16.4 | | Uninstalled | camel-2.16.4 |
jpa | 1.0.4 | | Uninstalled | enterprise-4.0.8 | OSGi Persistence Container
jpa | 2.3.0 | x | Started | enterprise-4.0.8 | OSGi Persistence Container
openjpa | 2.2.2 | | Uninstalled | enterprise-4.0.8 | Apache OpenJPA 2.2.x persistence engine support
openjpa | 2.3.0 | | Uninstalled | enterprise-4.0.8 | Apache OpenJPA 2.3.x persistence engine support
openjpa | 2.4.1 | | Uninstalled | enterprise-4.0.8 | Apache OpenJPA 2.4.x persistence engine support
deltaspike-jpa | 1.3.0 | | Uninstalled | org.ops4j.pax.cdi-1.0.0.RC1 | Apache Deltaspike jpa support
drools6-jpa | 6.2.0.Final | | Uninstalled | servicemix-kie-7.0.0 | Drools 6 JPA support
The JPA 2.3.0 is coming from enterprise-4.0.8 features repository with URL mvn:org.apache.karaf.features/enterprise/4.0.8/xml/features
Repository list
karaf#root>feature:repo-list
Repository | URL
-------------------------------------------------------------------------------------------------------
org.ops4j.pax.cdi-0.12.0 | mvn:org.ops4j.pax.cdi/pax-cdi-features/0.12.0/xml/features
jclouds-1.9.1 | mvn:org.apache.jclouds.karaf/jclouds-karaf/1.9.1/xml/features
org.ops4j.pax.jdbc-0.9.0 | mvn:org.ops4j.pax.jdbc/pax-jdbc-features/0.9.0/xml/features
camel-2.16.4 | mvn:org.apache.camel.karaf/apache-camel/2.16.4/xml/features
activemq-core-5.14.3 | mvn:org.apache.activemq/activemq-karaf/5.14.3/xml/features-core
org.ops4j.pax.web-4.3.0 | mvn:org.ops4j.pax.web/pax-web-features/4.3.0/xml/features
enterprise-4.0.8 | mvn:org.apache.karaf.features/enterprise/4.0.8/xml/features
org.ops4j.pax.cdi-1.0.0.RC1 | mvn:org.ops4j.pax.cdi/pax-cdi-features/1.0.0.RC1/xml/features
framework-4.0.8 | mvn:org.apache.karaf.features/framework/4.0.8/xml/features
standard-4.0.8 | mvn:org.apache.karaf.features/standard/4.0.8/xml/features
cxf-3.1.5 | mvn:org.apache.cxf.karaf/apache-cxf/3.1.5/xml/features
activemq-5.14.3 | mvn:org.apache.activemq/activemq-karaf/5.14.3/xml/features
servicemix-kie-7.0.0 | mvn:org.apache.servicemix.features/servicemix-kie/7.0.0/xml/features
spring-4.0.8 | mvn:org.apache.karaf.features/spring/4.0.8/xml/features
servicemix-features-7.0.0 | mvn:org.apache.servicemix.features/servicemix-features/7.0.0/xml/features
servicemix-examples-7.0.0 | mvn:org.apache.servicemix.features/servicemix-examples/7.0.0/xml/features
I hope this can help.

hawtio-web stuck "deploying", won't start in karaf

( hawtio version 1.4.27, karaf version 3.0.2 )
i'm not quite sure what i'm missing here. I ran the following console commands to deploy the hawtio feature to Karaf
karaf#local()> feature:repo-add mvn:io.hawt/hawtio-karaf/1.4.27/xml/features
Adding feature url mvn:io.hawt/hawtio-karaf/1.4.27/xml/features
karaf#local()> feature:install hawtio-core
karaf#local()> web:list
ID | State | Web-State | Level | Web-ContextPath | Name
-----------------------------------------------------------------------------------------
216 | Active | Deploying | 80 | /hawtio | hawtio :: hawtio-web (1.4.27)
karaf#local()>
As suggested here i'm installing only the hawtio-core feature.
however, the war bundle 207 ( hawtio-web ) is forever stuck in the "Deploying" web-state. I don't see any servlets installed either
karaf#local()> http:list
ID | Servlet | Servlet-Name | State | Alias | Url
-------------------------------------------------
karaf#local()>
According to log:display ( the root logger is running on INFO and logging to osgi:* ) these are the only relevant lines logged
2014-10-22 16:09:17,783 | WARN | e ssh user karaf | FeatureValidationUtil | 24 - org.apache.karaf.features.core - 3.0.1 | Old style feature file without namespace found (URI: mvn:io.hawt/hawtio-karaf/1.4.27/xml/features). This format is deprecated and support for it will soon be removed
2014-10-22 16:10:03,770 | INFO | e ssh user karaf | FeaturesServiceImpl | 24 - org.apache.karaf.features.core - 3.0.1 | Installing feature hawtio-core 1.4.27
2014-10-22 16:10:03,771 | INFO | e ssh user karaf | FeaturesServiceImpl | 24 - org.apache.karaf.features.core - 3.0.1 | Installing feature war 3.0.1
Any ideas on how i could debug this, as nothing indicating a problem is logged, the war is "stuck" and the /hawtio resource is not available?
thanks!
Andras
PBKAC - i had org.osgi.core and org.osgi.compendium downloaded by maven and added to the karaf "lib" folder. They creeped on to the classpath ( definitely not listed in -cp though ) - as karaf/felix provide the packages in these, they are redundant and apparently cause extremely difficult to debug problems ( again, not a single line logged indicating a problem )
tl;dr this is not reproducible with the 3.0.2 karaf release tar. Drop osgi.core and osgi.compendium in the lib folder however..

Web app with JPA doesn't work on extenal Tomcat server

I've some problems with publishing my Dynamic Web application in Tomcat, on my VPS server.
I developed an application which contains Servlet( creating Entity Manager and doing operations on the database), and jar files - also Entity components are packed in jar file.
Application uses eclipselink and postgresql.
On Tomcat 7 Server installed witch eclipse, everything works fine, but when I try to deploy it to Tomcat 7 Server on my VPS I'm getting an exception:
javax.servlet.ServletException: Error instantiating servlet class pl.marekbury.controller.StoreServer
and the root cause
javax.naming.NameNotFoundException: Name [pl.marekbury.controller.StoreServer/PERSISTENCE_UNIT_NAME] is not bound in this Context. Unable to find [pl.marekbury.controller.StoreServer].
I had also the same error on my localhost eclipse-integrated server, but i found a solution (somwere here, on stack) to chcange eclipselink version, after I did id, error's gone.
I'm deploying app in these way:
- export war from eclispe
- deploy it trough tomcat web manager
I tried:
- Change server to Tomee
- Place all jar libs in WEB-INF/lib
Structure of application folder after deploying to tomcat:
----krzyzyk
| |---index.jsp
|---META-INF
| |---MANIFEST.MF
|
|---WEB-INF
| |---web.xml
| |---lib
| | |---all jar files(entities,servlet-api itd..)
| |
| |---classes
| | |---META-INF(remain after making jar with entities)
| | |---pl
| | | |---marekbury
| | | | |---controller
| | | | | |---StoreServer.class
| | | | |---model
| | | | | |---entities
| | | | | | |---User.class (remain after making jar with entities)
index.jsp makes http request to servlet StoreServer
Any ideas how to make it run properly?
I have found solution. Error was caused by different Java versions on vps(oracle 1.7) and my computer(openJDK 1.7). I have made .WAR on VPS and everything works fine.

Problems with clear case plugin eclipse

I have a following problems with eclipse, when I installed ClearCase plugin from this url http://www3.software.ibm.com/ibmdl/pub/software/rationalsdp/clearcase/60/update/windows/ :
Has anyone experienced the similar problem? I'm using Windows 7 and eclipse galileo. I've installed the plugin from this URL, what can I do to work this problem out?
For those who can't see tinypic images
+----------------------------------------------------------------------+
| Connect to the Rational ClearCase failed |
| |
| Connect to the Rational ClearCase failed |
| |
| Reason: |
| Select Details >> for more information. |
| |
| +------------+ +------------+ |
| | OK | | << Details | |
| +------------+ +------------+ |
| |
|Could not connect to the Rational Clearcase. Please ensure that proper|
|version of ClearCase is installed with the proper patches. Consult the|
|ClearCase SCM Adapter documentation for further details. |
| |
| |
|Provider name: IBM |
|Plugin name: Rational ClearCase SCM Adapter |
|Plugin ID: com.rational.clearcase |
|Version: 7.5.0.v200910221234 |
+----------------------------------------------------------------------+
Google doesn't help much ..
I have no problem with that plugin (except the MVFS layer does not work for now, since dynamic views are not yet supported on windows7), provided you do have the exact tree
yourEclipse
eclipse
plugins
com.rational.clearcase.help_7.5.0.v200910221234
com.rational.clearcase.activities_7.5.0.v200910221234
com.rational.clearcase_7.5.0.v200910221234
features
com.rational.clearcase_7.5.0.v200910221234
com.ibm.rational.clearcase.ccrefresh_7.5.0.v200910221234
com.ibm.rational.clearcase.ccimport.feature_7.1.0.v200905202348--08422A2_242663
So you can start and check if you do see this configuration.
Note: I only install it on Eclipse Galileo 3.5 and Eclipse Helios 3.6Mx.
Currently, version 1.6 of the JVM is not supported. To use this integration successfully, you must downgrade to JVM 1.5.
As far as I know, the latest version of ClearCase available is 7.1, which is not qualified on Windows 7, maybe the issue is there.
Did you try with in the integration/plugin for other IDE ? (VisualStudio ?)
Can you access your views (snapshot or dynamic) outside of eclipse ?

Categories

Resources