cancel
Showing results for 
Search instead for 
Did you mean: 

Can't find source table 'junit_props' in database.

0 Kudos
1,209

Dear experts, et. al.,

We are implementing a patch and after replacing all the contents of the bin folder from the old to the new version we get the error below:

 SEVERE: Exception sending context initialized event to listener instance of class de.hybris.platform.testweb.spring.TenantUnawareHybrisContextLoaderListener
 java.lang.IllegalArgumentException: Can't find source table 'junit_props' in database.
     at de.hybris.bootstrap.ddl.tools.TablesStructureCopier.requireValidTablesMapping(TablesStructureCopier.java:52)
     at de.hybris.bootstrap.ddl.tools.TablesStructureCopier.getCopyStatements(TablesStructureCopier.java:36)
     at de.hybris.bootstrap.ddl.tools.MigrateTypeSystemProps.createTypeSystemPropsTable(MigrateTypeSystemProps.java:67)
     at de.hybris.bootstrap.ddl.tools.MigrateTypeSystemProps.getStatementsToExecute(MigrateTypeSystemProps.java:57)
     at de.hybris.bootstrap.ddl.tools.TypeSystemHelper.assureTypeSystemStructureIsUpToDate(TypeSystemHelper.java:123)
     at de.hybris.platform.core.AbstractTenant.assureTypeSystemStructureIsUpToDate(AbstractTenant.java:868)
     at de.hybris.platform.core.AbstractTenant.doStartupSafe(AbstractTenant.java:776)
     at de.hybris.platform.core.AbstractTenant.doStartUp(AbstractTenant.java:724)
     at de.hybris.platform.core.Registry.assureTenantStarted(Registry.java:647)
     at de.hybris.platform.core.Registry.activateTenant(Registry.java:708)
     at de.hybris.platform.core.Registry.setCurrentTenant(Registry.java:552)
     at de.hybris.platform.core.Registry.setCurrentTenantByID(Registry.java:684)
     at de.hybris.platform.spring.HybrisContextLoaderListener.adjustTenant(HybrisContextLoaderListener.java:249)
     at de.hybris.platform.spring.HybrisContextLoaderListener.doInitWebApplicationContext(HybrisContextLoaderListener.java:160)
     at de.hybris.platform.spring.HybrisContextLoaderListener.initWebApplicationContext(HybrisContextLoaderListener.java:143)
     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
     at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitialized(HybrisContextLoaderListener.java:79)
     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5157)
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5680)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1707)
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1697)
     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
     at java.lang.Thread.run(Thread.java:748)

This problem only happens when we set the following property: installed.tenants=junit

We tried to execute ant initialize -Dtenant=junit but it did not make any difference. The tables are not there, but with the older version of hybris (6.3.0.7) it worked well

Any help will be greatly appreciated!

Regards,

Luis

geffchang
Active Contributor
0 Kudos

What version are you upgrading to? 1811?

former_member624549
Participant
0 Kudos

did you try "ant yunitinit" ?

0 Kudos

From 6.3.0.7 to 6.3.0.26

View Entire Topic
hjaenisch
Discoverer
0 Kudos

I went into the same issue when running the integration and unit tests on our CI server. The build steps we performed were something like this:

1. ant clean all

2. ant yunitinit

3. ant unittests

Step 2) failed with a similar exception like you reported:

 [java] INFO  [main] (junit) [AbstractTenant] Created master data source DataSourceImpl<<junit/master>>
     [java] INFO  [main] (junit) [AbstractTenant] Created alternative data source "alt1"
     [java] INFO  [main] (junit) [AbstractTenant] Created alternative data source "alt2"
     [java] INFO  [main] (junit) [AbstractTenant] Created alternative data source "a"
     [java] INFO  [main] (junit) [AbstractTenant] Created alternative data source "b"
     [java] INFO  [main] (junit) [AbstractTenant] Created alternative data source "c"
     [java] INFO  [Task-master-poll] [ConfigurableTasksProvider] no tasks provider defined - default tasks provider (de.hybris.platform.task.impl.DefaultTasksProvider) will be used
     [java] Exception in thread "main" java.lang.reflect.InvocationTargetException
     [java] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java] 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
     [java] 	at de.hybris.bootstrap.loader.Loader.execute(Loader.java:143)
     [java] 	at de.hybris.bootstrap.loader.Loader.main(Loader.java:117)
     [java] Caused by: Sourced file: inline evaluation of: ``de.hybris.platform.core.Initialization.initializeTestSystem();                   . . . '' : Method Invocation de.hybris.platform.core.Initialization.initializeTestSystem : at Line: 1 : in file: inline evaluation of: ``de.hybris.platform.core.Initialization.initializeTestSystem();                   . . . '' : de .hybris .platform .core .Initialization .initializeTestSystem ( ) 
     [java] 
     [java] Target exception: java.lang.IllegalArgumentException: Can't find source table 'junit_props' in database.

After hours of investigation I figured out the reason. By mistake, one of the CI preparation steps overrode the local.properties which have been generated out of the unittest.properties. As a result, there was the following wrong line in the local.properties when the junit tenant was started on the CI server:

system.unlocking.disabled=true

It seems that this misconfiguration was the cause of the trouble. When fixing the configuration, the target yunitinit worked as expected - the schema was created with all tables in the HSQL database and the unit tests and integration tests could be executed.

MehmetTK
Newcomer
0 Kudos
You made my day