Exception occurs at the end of test cases - maven

I'm using Maven for dependency management. When I run the test cases an exception occurs at the end of test cases though test cases pass successfully.
Following is my stack trace:
2013-10-08 16:04:22,839 [Thread-15] ERROR plugins.DefaultGrailsPlugin - Error configuration scaffolding: Error creating bean with name 'instanceControllersApi': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
Message: Error creating bean with name 'instanceControllersApi': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
Line | Method
->> 662 | run in java.lang.Thread
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I'm using Grails 2.1.3. I have tried both, "static" and "dynamic" scaffolding but it did not resolve the issue.
I also referred to What does this exception mean? issue but no luck.

One user with a similar error fixed it by deleting the project folder in his ~/.grails directory.
http://grails.1312388.n4.nabble.com/Database-migration-plugin-Running-dbm-gorm-diff-results-Error-creating-bean-with-name-instanceContro-td4637567.html
A good ol' grails clean might help too, and be less invasive.
Also, if you can share the project through source control (git, mercurial, svn), you might try reproducing the issue on another machine. If you can't, that's a good sign that the issue is peculiar to your environment, and could be resolved through some sort of cleanup.

I have resolved my issue. I am not sure why it was occurring but i had many controller where scaffold=true. I generated the all controller and view and it resolved my issue.

Related

Unable to obtain table lock - another Flyway instance may be running

I'm using integration of Spring Boot and Flyway (6.5.5) to run updates for CockroachDB cluster. When several instances of service are starting in the same time, all of them are trying to lock flyway_schema_history table to validate migrations. However, the following exception occurs:
2020-09-09 00:00:00.013 ERROR 1 --- [ main] o.s.boot.SpringApplication :
Application run failed org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]:
Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException:
Unable to obtain table lock - another Flyway instance may be running
I could not find any config property to tweak this. Maybe someone faced with the same issue and solved it somehow?
Workaround: restart service.
After debugging the issue, it's appeared in very weird Flyway behaviour:
org.flywaydb.core.internal.database.cockroachdb.CockroachDBTable
CockroachDB-specific table.
Note that CockroachDB doesn't support table locks. We therefore use a row in the schema history as a lock indicator;
if another process ahs inserted such a row we wait (potentially indefinitely) for it to be removed before
carrying out a migration.
*/
So, in my case during applying migration, service was restarted and this pseudo lock record left forever.
Workaround was delete the "lock" manually:
installed_rank | version | description | type | script | checksum | installed_by | installed_on | execution_time | success
-----------------+----------------------------------+------------------------------------------+------+--------------------------------------------------+-------------+--------------------+----------------------------------+----------------+----------
-100 | d9ab17626a4d66a4d8a89fe9bdca98e9 | flyway-lock | | | 0 | | 2020-09-14 11:25:02.874838+00:00 | 0 | true
Hope, it will help someone.
The appropriate ticket has been created: https://github.com/flyway/flyway/issues/2932

flyway upgrade from 4.X to 5.x runs the already ran migration scripts again

I was upgrading springboot 2 from 1.5. For that, I upgraded the flyway from 4.X to 5.24. When I run the springboot application after that, it's executing scripts which were already executed. Below is the logs I am seeing. removing project specific names as I am not allowed to post it:
myproject INFO 2019-03-11T16:08:11-0400 main [org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory] Creating Schema History table: "PUBLIC"."flyway_schema_history"
myproject INFO 2019-03-11T16:08:11-0400 main [org.flywaydb.core.internal.command.DbMigrate] Current version of schema "PUBLIC": << Empty Schema >>
myproject INFO 2019-03-11T16:08:11-0400 main [org.flywaydb.core.internal.command.DbMigrate] Migrating schema "PUBLIC" to version 1 - CREATE mything
myproject ERROR 2019-03-11T16:08:11-0400 main [org.flywaydb.core.internal.command.DbMigrate] Migration of schema "PUBLIC" to version 1 - CREATE mything failed! Please restore backups and roll back database and code!
myproject WARN 2019-03-11T16:08:11-0400 main [org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException:
Migration V1__CREATE_mything.sql failed
---------------------------------------
SQL State : 42509
Error Code : -5509
Message : type not found or user lacks privilege: SERIAL
I guess You are using default value for parameter table.name, which changed in v. 5.0.0.
Refer to https://flywaydb.org/documentation/releaseNotes
Issue 1848 The default for flyway.table has been changed from schema_version to flyway_schema_history

hybris checkout add on issue

New checkoutaddon extenssion named as "myb2ccheckout"
Included in localextensions.xml (hybris/config)
classpath : in "myb2ccheckout"
localextensions in "myb2ccheckout"
spring.xml firl we have created "Multi check out flow"
controller
ant addoninstall -Daddonnames="myb2ccheckout" -DaddonStorefront.yacceleratorstorefront="myb2cstorefront"
Base Store
UPDATE BaseStore;uid[unique=true];checkoutFlowGroup;hybris;myMultiFlowCheckoutGroup;
exception ::
SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [/myb2cstorefront] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
INFO|jvm 1| main|2015/09/02 19:19:05.034 | java.lang.NullPointerException
INFO|jvm 1|main 2015/09/02 19:19:05.034 |at de.hybris.platform.storefront.controllers.pages.checkout.steps.AbstractCheckoutStepController.addCheckoutStepsToModel(AbstractCheckoutStepController.java:115)
Based on the line number provided in the error log, it seems you have issues with the checkout group. Kindly check if the bean mapping for checkout group mentioned correctly.
Do let me know if this resolves the issue. Cheers.
Following steps resolved my problem:
Check if your checkout flow group is installed:
go to hybris backoffice->base commerce ->base store -> -> administration ->Checkout Flow Group.
If above property is correctly set to your desired checkout flow group then once again install the addon:
ant addoninstall -Daddonnames="myb2ccheckout" -DaddonStorefront.yacceleratorstorefront="myb2cstorefront"
ant clean all
I did not need ant initialize/update because I already did it while installing my checkout addon first time.

Unsatisfied dependency on javax.sql.DataSource

I have a maven + spring based application which I built and deployed in Servicemix.
However, when tried to start the bundle, it remained in the Waiting status for a long time before generating following exception:
16:25:52,219 | DEBUG | Timer-0 | DependencyServiceManager | startup.DependencyServiceManager 339 | 72 - org.springframework.osgi.extender - 1.2.0 | Deregistering service dependency dependencyDetector for OsgiBundleXmlApplicationContext(bundle= abc, config=osgibundle:/META-INF/spring/*.xml)
16:25:52,219 | ERROR | Timer-0 | WaiterApplicationContextExecutor | WaiterApplicationContextExecutor 432 | 72 - org.springframework.osgi.extender - 1.2.0 | Unable to create application context for [abc], unsatisfied dependencies: Dependency on [(objectClass=javax.sql.DataSource)] (from bean [&dataSource])
org.springframework.context.ApplicationContextException: Application context initialization for 'com.vetstreet.pet_mailer' has timed out
Appreciate any help or suggestion.
Spring Extender holds back the startup of an application (setting it's status to Waiting) if a service that you're referencing is unavailable at startup. The reason is that the availability attribute of every referenced service is set to mandatory, and
there's a default-timeout global attribute which is by default set to 5 seconds. If the service you're referring to doesn't appear in that amount of time, Spring Extender will throw an Exception like that you have.
So what I think is something wrong with the service publication of your DataSource. Do you have the corresponding tag in your other application?
<osgi:service ...>
Check out this link: http://static.springsource.org/osgi/docs/2.0.0.M1/reference/html/service-registry.html. It contains a lot of example. Ensure that in both osgi:service and both osgi:reference you have the javax.sql.DataSource interface set. And be aware of not publishing the same interface by 2 different bundles.
One more thing: just to be sure, import the javax.sql package in your manifest:
<Import-Package>javax.sql</Import-Package>
Hope this helps, Gergely

How to install the admin panel in 1.0

I'm trying to install it but with no success.
Steps:
1. copied admin.jsp to /red5/webapps/root
2. Pasted all the jars from adminplugin-1.0.zip to /red5/plugins
3. started the server. ERROR:
[INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#1fa490e: defining beans [global.clientRegistry,global.serviceInvoker,global.mappingStrategy,global.context,global.handler,global.scope,red5.scopeResolver]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory#be49e0
[WARN] [main] org.red5.server.ContextLoader - Context destroy failed for: default.context
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'default.context' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
So what's the procedure, i can't find it. I've been trying for the whole month to accomplish this!
You should check if the adminpanel does work with the red5 version you are using. Where did you download adminpanel from? I guess you might contact the mailing list to find the author of the adminpanel.
You can see the last commits / changes of the admin application have been done in 2008:
https://code.google.com/p/red5/source/browse/#svn%2Fflash%2Ftrunk%2Fadmin
I don't think that it is actively maintained at the moment, so it is actually your job to get it running and debug it if you need it.

Resources