Facing issue while loading app to PCF - pcf

Bean method 'configServicePropertySource' in 'ConfigServiceBootstrapConfiguration' not loaded because #ConditionalOnProperty (spring.cloud.config.enabled) found different value in property 'spring.cloud.config.enabled'
2017-12-17T14:40:46.20+0530 [APP/PROC/WEB/0] OUT Field locator in io.pivotal.spring.cloud.service.config.ConfigClientOAuth2BootstrapConfiguration$ConfigClientOAuth2Configurer required a bean of type 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' that could not be found.
-I am receiving the above message when I am trying to load it into PCF. But when running locally, it is working as expected.

When this error message appeared in a Spring Boot 2.01 / Pivotal Cloud Foundry / Groovy / Gradle environment, one additional thing I noticed was that the problem went away when I removed the dependency on the Spring Boot based module that was being developed.
The fix was to change the build.gradle of the imported module so that dependencies were compileOnly() instead of compile().
Like this,
compileOnly('org.springframework.boot:spring-boot-starter')
compileOnly('org.springframework.boot:spring-boot-starter-amqp')
compileOnly('org.springframework.cloud:spring-cloud-config-server')
compileOnly('org.springframework.boot:spring-boot-configuration-processor')
testCompile('org.springframework.boot:spring-boot-starter')
testCompile('org.springframework.boot:spring-boot-starter-amqp')
testCompile('org.springframework.cloud:spring-cloud-config-server')
Instead of,
compile('org.springframework.boot:spring-boot-starter')
compile('org.springframework.boot:spring-boot-starter-amqp')
compile('org.springframework.cloud:spring-cloud-config-server')
compile('org.springframework.boot:spring-boot-configuration-processor')
My theory is that there was a conflict between multiple instances of the Spring Boot framework in the environment and this removed one of them, but I'm not certain if that is correct.
Here is the complete error message from my environment:
***************************
APPLICATION FAILED TO START
Description:
Parameter 1 of constructor in io.pivotal.spring.cloud.service.config.ConfigClientOAuth2BootstrapConfiguration$ConfigClientOAuth2Configurer required a bean of type 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' that could not be found.
- Bean method 'configServicePropertySource' in 'ConfigServiceBootstrapConfiguration' not loaded because #ConditionalOnProperty (spring.cloud.config.enabled) found different value in property 'spring.cloud.config.enabled'
Action:
Consider revisiting the conditions above or defining a bean of type 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' in your configuration.
While troubleshooting different combinations of Spring Boot modules I also saw this error, which I believe had the same cause:
***************************
APPLICATION FAILED TO START
Description:
Parameter 0 of constructor in io.pivotal.spring.cloud.service.config.VaultTokenRenewalAutoConfiguration required a bean of type 'io.pivotal.spring.cloud.service.config.ConfigClientOAuth2ResourceDetails' that could not be found.
[OUT] Action:
[OUT] Consider defining a bean of type 'io.pivotal.spring.cloud.service.config.ConfigClientOAuth2ResourceDetails' in your configuration.

Related

Argument 1 passed to SymfonyFixturesLoader::addFixture() must be an instance of Doctrine\Common\DataFixtures\FixtureInterface

Full error - Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Doctrine\Bundle\FixturesBundle\Loader\SymfonyFixturesLoader::addFixture() must be an instance of Doctrine\Common\DataFixtures\FixtureInterface, instance of Abstrat\OAuthBundle\Controller\TokenController given, called in /var/www/html/vendor/doctrine/doctrine-fixtures-bundle/Loader/SymfonyFixturesLoader.php on line 36 in /var/www/html/vendor/doctrine/doctrine-fixtures-bundle/Loader/SymfonyFixturesLoader.php on line 40
I'm setting up a new Symfony 3.4 API server as i'm migrating code across from an old Symfony 2.7 API server. I have included a couple of custom bundles via composer, with Abstrat\OAuthBundle being one of them (see error in title as this bundle seems to be what's causing the problem)
I haven't created any bundles in ./src yet as I want to get the include libraries working before hand
I can't see why the Abstrat\OAuthBundle that i'm including is being passed to addFixture()
Any help/suggestions would be appreciated

Need to provide addtional jars to for xsbt-web-plugin container

I am trying to run my war file using xsbt-web-plugin. My war itself does not contain tomcat-jdbc-pool jar and javax-servlet-api. I tried using container configuration. But sbt complains configuration does not exist.
If I use provided configuration, webapp-runner fails.
I am sure I am missing something. But unable to figure it out.
WARNING: Failed to register in JMX: [javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool.DataSourceFactory]]
What version of xsbt-web-plugin are you using? Can you post the contents of your sbt build configuration?
The Tomcat plugin in xsbt-web-plugin relies on webapp-runner, which does not appear to bundle the tomcat-jdbc library. You can add it via containerLibs in Tomcat:
enablePlugins(TomcatPlugin)
containerLibs in Tomcat += "org.apache.tomcat" % "tomcat-jdbc" % "8.5.15"

Configuration files are ignored after migrating to Servicemix 5

We use a .cfg file in ./etc directory to configure our bundle in ServiceMix. Everything worked fine in SMX 4.5.3, but when migrating to the 5th version the file is not picked up. When the bundle encounters a property the following exception is thrown:
java.lang.IllegalArgumentException: Property with key [xslt.dir] not found in properties from text: {{xslt.dir}}, StackTrace: org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: Property with key [xslt.dir] not found in properties from text: {{xslt.dir}}
However, if I put the properties in default-properties section in my blueprint configuration, it works.
Also, the console command config:list actually shows the properties for the bundle in spite of the exception:
Pid: misrouter
BundleLocation: mvn:ru.mig/mis-router/1.0-SNAPSHOT
Properties:
service.pid = misrouter
felix.fileinstall.filename = file:/home/petr/programs/5.0.0-apache-servicemix/etc/misrouter.cfg
xslt.dir = /home/petr/programs/5.0.0-apache-servicemix/xslt
So was something changed in SMX 5 configuration mechanism or is there a bug in it?
What version of the JDK/JRE are you using? When I was trying this out a few minutes ago to answer your question, I also had some problems using the 1.7.0_15 version I had installed and upgrading to the latest 1.7.0_51 fixed those for me.
Actually it's related to Camel vm component, a bug was created for SMX

Web setup project fails to install dynamic-data site: "the installer was interrupted"

The last phase of the installer fails with this message:
Installation Incomplete
The installer was interrupted before [project] could be installed. You need to restart the installer to try again.
Running msiexec /i installer.msi /l*vx setup.log shows the following entries in the setup log:
INFO : [...] [ApplyWebFolderProperties]: Getting web folder property token...
INFO : [...] [ApplyWebFolderProperties]: Token is '/LM/W3SVC/1/ROOT/ProjectDir/DynamicData/Filters'.
INFO : [...] [ApplyWebFolderProperties]: Getting METADATA_HANDLE for the directory '/LM/W3SVC/1/ROOT/ProjectDir/DynamicData/Filters'.
ERROR : [...] [ApplyWebFolderProperties]: FAILED: -2147024893
ERROR : [...] [ApplyWebFolderProperties]: FAILED: -2147024893
ERROR : [...] [ApplyWebFolderProperties]: Custom Action failed with code: '3'
ERROR : [...] [ApplyWebFolderProperties]: Custom Action failed with code: '3'
INFO : [...] [ApplyWebFolderProperties]: Custom Action completed with return code: '3'
The same web application had no problems being installed with a web setup project before. The issue started after upgrading the web application from .NET 3.5 SP1 to .NET 4.0.
This blog entry points out the issue:
Which got me started thinking, I have
a subfolder named filters. Changing
nothing else but renaming the filters
subfolder made it finish properly. I'm
assuming you might have the same
problems with folders named apppools,
info, or 1 as well.
(Emphasis mine)
Unfortunately, Filters is a hard-coded folder name in Dynamic Data. If you look at FilterFactory, there doesn't appear to be any way to override that value, seeing as how the FilterFactory property of MetaModel is not marked virtual. If we can't change the folder name, then we have to look at fixing the installer...
The installer error is being raised by the ApplyWebFolderProperties custom action. That action isn't built-in to Windows Installer—it's added by the Web Setup Project. That's helpful, because it means we can remove it with WiRunSQL.vbs:
cscript WiRunSQL.vbs installer.msi "DELETE FROM CustomAction WHERE Action='WEBCA_ApplyWebFolderProperties'"
Note that the actual name of ApplyWebFolderProperties is WEBCA_ApplyWebFolderProperties. Seeing as how the action doesn't appear to be documented anywhere, caveat emptor. It doesn't appear to be too terribly important though.
To automate the workaround, you could add the command to the setup project's PostBuildEvent like so:
cscript.exe "$(ProjectDir)..\WiRunSQL.vbs" "$(BuiltOuputPath)" "DELETE FROM CustomAction WHERE Action='WEBCA_ApplyWebFolderProperties'"
If anyone knows a better way to install a folder named Filters, I'd love to hear it.

seam solder (former weld-extensions project) is not initialized

I want to use logger in my java web application.
I'm using JBossAS 6.0.0.final, cdi (weld), jsf ... etc. Seam solder proposes to use an abstract logger is not tying to a concrete implementation (slf4j, log4j, etc) using jboss-logging api.
In order to get this logger in your code will need to write
# Inject
org.jboss.logging.Logger log
seam-solder.jar has the producer for this logger.
package org.jboss.seam.solder.log;
...
class LoggerProducers
{
# Produces
org.jboss.logging.Logger produceLog (InjectionPoint injectionPoint) {}
}
When I deploying my application, I get an error
15:51:18,300 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///C:/Java/jboss-6.0.0.Final/server/default/deploy/kamis-web-client.5.0.0-SNAPSHOT.ear_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [#Default] at injection point [[field] #Inject private ru.kamis.suite.webclient.web.breadcrumbs.BreadcrumbsManager.log]
This is due to the seam-solder.jar has not META-INF/beans.xml file, and it is necessary for cdi container.
If to add beans.xml file in seam-solder.jar manually, then the application works WELL.
How to do without hacks?
To build my application I use maven, so my solution is not comfortable and NOT fine.
PS: Former weld-extensions project contained META-INF/beans.xml file in jar.
with seam-solder-3.0.0.Beta1 there should be no need to modify the jar

Resources