I deployed Tomcat from scratch and added the mysql JAR to the Tomcat lib
directory and edited or checked persistence.properties and
provisioning.properties, then rebuilt using mvn and re-deployed the WARs to
Tomcat.
Now, I get the following during Tomcat startup (following is from Tomcat
localhostxx.log):
02-Apr-2019 15:17:12.666 INFO [main]
org.apache.catalina.core.ApplicationContext.log ContextListener:
contextInitialized()
02-Apr-2019 15:17:12.666 INFO [main]
org.apache.catalina.core.ApplicationContext.log SessionListener:
contextInitialized()
02-Apr-2019 15:17:12.667 INFO [main]
org.apache.catalina.core.ApplicationContext.log ContextListener:
attributeAdded('StockTicker', 'async.Stockticker@4a23350')
02-Apr-2019 15:17:20.790 INFO [main]
org.apache.catalina.core.ApplicationContext.log No Spring
WebApplicationInitializer types detected on classpath
02-Apr-2019 15:17:21.052 INFO [main]
org.apache.catalina.core.ApplicationContext.log Initializing Spring root
WebApplicationContext
02-Apr-2019 15:17:31.835 SEVERE [main]
org.apache.catalina.core.StandardContext.listenerStart Exception sending
context initialized event to listener instance of class
[org.springframework.web.context.ContextLoaderListener]
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.springframework.security.filterChains': Cannot resolve reference
to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while
setting bean property 'sourceList' with key [0]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.springframework.security.web.DefaultSecurityFilterChain#0':
Cannot resolve reference to bean 'jwtAuthenticationFilter' while setting
constructor argument with key [2]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'jwtAuthenticationFilter' defined in URL
[jar:file:/apps/apache-tomcat-9.0.17/webapps/syncope/WEB-INF/lib/syncope-core-spring-2.1.3.jar!/securityContext.xml]:
Cannot resolve reference to bean 'authenticationManager' while setting bean
property 'authenticationManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.springframework.security.authenticationManager': Cannot resolve
reference to bean 'usernamePasswordAuthenticationProvider' while setting
constructor argument with key [0]; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'usernamePasswordAuthenticationProvider': Unsatisfied
dependency expressed through field 'provisioningManager'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name '${userProvisioningManager}#0': Unsatisfied dependency
expressed through field 'taskExecutor'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name '${propagationTaskExecutor}#0': Unsatisfied dependency
expressed through field 'taskDataBinder'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'taskDataBinderImpl': Unsatisfied dependency expressed
through field 'scheduler'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'quartzDataSourceInit' defined in URL
[jar:file:/apps/apache-tomcat-9.0.17/webapps/syncope/WEB-INF/lib/syncope-core-provisioning-java-2.1.3.jar!/provisioningContext.xml]:
Invocation of init method failed; nested exception is
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain
JDBC Connection; nested exception is
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link
failure
The last packet sent successfully to the server was 0 milliseconds ago. The
driver has not received any packets from the server.
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:378)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:401)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:159)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1648)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1400)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:827)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
When I access the syncope-console via browser I get the same 404 error.
Jim
On Tuesday, April 2, 2019, 9:56:27 AM EDT, Francesco Chicchiriccò
<[email protected]> wrote:
On 02/04/19 15:33, o haya wrote:
Hi,
Now, when I startup Tomcat, I am seeing this in the catalina.out:
02-Apr-2019 13:17:06.383 WARNING [main]
org.apache.tomcat.jdbc.pool.ConnectionPool.checkPoolConfiguration maxIdle is
larger than maxActive, setting maxIdle to: 50
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver
class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via
the SPI and manual loading of the driver class is generally unnecessary.
02-Apr-2019 13:17:06.604 SEVERE [main]
org.apache.tomcat.jdbc.pool.ConnectionPool.init Unable to create initial
connections of pool.
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link
failure
This is error says it all: Syncope is not able to connect to MySQL.
Could that be why I am getting that connection error now? Should I remove
that <Resource> from the Tomcat context.xml now?
Yes, remove it.
Start with a clean Tomcat, if possible.
Regards.
On Tuesday, April 2, 2019, 8:40:52 AM EDT, Francesco Chicchiriccò
<[email protected]> wrote:
FYI, the only Master.properties that matters is
/apps/syncope/myproject/core/src/main/resources/domains/Master.properties
because:
* anything under target/ is going to disappear at next build * the one under
test/ is used for the embedded mode, and should not be touched * the one under
/apps/apache-tomcat-9.0.17/webapps/syncope/ is your deployed webapp, there is
no point in changing that one
Syncope 2.1 runs its whole integration test suite on Tomcat 9, and so does
embedded mode hence no, there is no issue with Tomcat 9.
As long as Syncope Core is not properly configured with its database
connection (Master.properties and provisioning.properties) there is no chance
you'll get anything but 404. I'd suggest to watch your Tomcat logs during
startup to identify the main issue - also looking at /opt/syncope/log/core.log
would help.
And don't forget to build as we said below, after making your changes to the
files.
Regards.
On 02/04/19 14:27, o haya wrote:
Re. "
It would have been
http://:8080/syncope/rest
"
You are correct, but I get a 404 error in that case also :)...
Re. the Master.properties, here is where I found the copies (FYI, all my work
is under /apps):
[root@ip-192-168-x logs]# find /apps/ -name "Master.properties"
/apps/apache-tomcat-9.0.17/webapps/syncope/WEB-INF/classes/domains/Master.properties
/apps/syncope/myproject/core/src/main/resources/domains/Master.properties
/apps/syncope/myproject/core/src/test/resources/domains/Master.properties
/apps/syncope/myproject/core/target/classes/domains/Master.properties
/apps/syncope/myproject/core/target/test-classes/domains/Master.properties
/apps/syncope/myproject/core/target/syncope/WEB-INF/classes/domains/Master.properties
I just change my Tomcat to listen to 8080 instead of 9080, and still get the
same error so I still really think that whatever is serviceing the
/syncope/rest endpoint is not working (thus the NOT_FOUND) and also I get this
in the Tomcat localhost_access.log every time I test:
127.0.0.1 - - [02/Apr/2019:12:17:46 +0000] "GET /syncope/rest/platform
HTTP/1.1" 404 1103
127.0.0.1 - - [02/Apr/2019:12:17:46 +0000] "GET /syncope/rest/platform
HTTP/1.1" 404 1103
172.31.xx.yy- - [02/Apr/2019:12:17:46 +0000] "GET /syncope-console/ HTTP/1.1"
500 8876
Also, FYI, I am using Tomcat 9.x. Is it possible that that is why this is
all not working?
NOTE that I am running the Tomcat and Syncope that I can only access via SSH
and HTTP/HTTPS from a browser on a workstation that is remote from the
Tomcat/Syncope server.
What I mean by that is that using a browser, I cannot access
http://localhost:8080 at all, only http://:8080.
Jim
On Tuesday, April 2, 2019, 8:13:57 AM EDT, Francesco Chicchiriccò
<[email protected]> wrote:
On 02/04/19 13:14, o haya wrote:
Hi,
In my latest attempt, I *DID* all this:
$ mvn clean verify \
-Dconf.directory=/opt/syncope/conf \
-Dbundles.directory=/opt/syncope/bundles \
-Dlog.directory=/opt/syncope/log
$ cp core/target/classes/*properties /opt/syncope/conf
$ cp console/target/classes/*properties /opt/syncope/conf
$ cp enduser/target/classes/*properties /opt/syncope/conf
$ cp enduser/target/classes/customFormAttributes.json /opt/syncope/conf
$ cp enduser/target/classes/customTemplate.json /opt/syncope/conf
and I still get the same error. Also FYI, when I point a browser to
http://:8080/rest, I get a 404 error from Tomcat.
It would have been
http://:8080/syncope/rest
in case, but this is obviously not working, as your database connection is not
set up propertly.
Also, as I said, so far, what I think I have realized is that I didn't do
the changes for using mysql (modifying the provisioning.properties and the
Master.properties). I am looking at doing those modifications now.
I did the provisioning.properties change already, but I found there are 5
instances of Master.properties. Which one do I have to change?
Where are such 5 instances of Master.properties located?
...are you sure you're not familiar enough with docker-compose? It would be
just straightforward.
Regards.
On Tuesday, April 2, 2019, 6:57:52 AM EDT, Francesco Chicchiriccò
<[email protected]> wrote:
On 02/04/19 12:49, o haya wrote:
Hi,
Thanks. To be clear, here is what I want to do/build:
- Use Syncope 2.1.3 - Use mysql for the internal storage - Use an LDAP
connector (eventually) to an external LDAP (an Oracle Unified Directory/OUD).
BUT I think I've been doing what you suggested (and just re-did everything
and got the same result... the NOT_FOUND error :().
Reading through your email below, I think that one thing I am missing/not
doing is your reference [8], setting up the provisioning.properties file for
mysql. The [8] reference is for postgre.
Do you know what the provisioning.properties should be for mysql?
Also, would me NOT configuring the provisioning.properties file cause the
problem that I am seeing?
Basically, I think that the problem I am having is that the /syncope/rest
endpoint is not working.
The problem is that Admin Console is incorrectly looking for Syncope Core (e.g
/syncope/rest) under
http://localhost:9080/syncope/rest
while instead it is deployed under
http://localhost:8080/syncope/rest
This is due by the fact that you are not building Syncope as expected for
deploying to an external Java EE container, e.g.
$ mvn clean verify \
-Dconf.directory=/opt/syncope/conf \
-Dbundles.directory=/opt/syncope/bundles \
-Dlog.directory=/opt/syncope/log
$ cp core/target/classes/*properties /opt/syncope/conf
$ cp console/target/classes/*properties /opt/syncope/conf
$ cp enduser/target/classes/*properties /opt/syncope/conf
$ cp enduser/target/classes/customFormAttributes.json /opt/syncope/conf
$ cp enduser/target/classes/customTemplate.json /opt/syncope/conf
Correct?
On Tuesday, April 2, 2019, 3:06:10 AM EDT, Francesco Chicchiriccò
<[email protected]> wrote:
Sooooo, let's do a little order.
1. you want to try Apache Syncope with LDAP - cool
2. you come to [1] and click the big green button labeled as "I want to
build my IdM with Apache Syncope"
3. you are brought to [2], where you can see that latest version is
2.1.3 Fusion and that there are many options available; also, some text
says "Don't know what to download? Click the buttons below to get more
information."
4. each buttons brings you to a different section of the Getting Started
guide [3], which explains pros and cons of the various distributions
In a nutshell:
* if you just want to look around, and like the idea of having some test
data with sample resources configured, go with Standalone Distribution
* if you are familiar with Docker, and don't need test data, just use
our images, possibly through docker-compose or Kubernetes (sample available)
* if you want to get full access to customization, stick with Maven but
please, follow the guide, e.g.
- create new project [4]
- (optionally) run it as embedded [5]
- as suggested by [6], "consider reading the Apache Syncope Reference
Guide. to understand how to configure, extend, customize and deploy your
new Apache Syncope project"
- about deployment, you will find [7], in the Reference Guide, and
understand that you need (1) to create your deployment directories and
(2) that you need to build the project in a different way than [4], in
order to deploy the three WAR files onto an external Java EE container
- you might also be interested in configuring which DBMS [8] to use
for internal storage (default is PostgreSQL)
Finally, you might find several posts about practical configurations in
my company's blog [9] - but, please, only consider the most reasonably
recent ones: did you notice that the post by Colm you started from is *6
years old*??!?
Hope this helps.
Regards.
[1] http://syncope.apache.org/
[2] http://syncope.apache.org/downloads
[3] http://syncope.apache.org/docs/getting-started.html
[4] http://syncope.apache.org/docs/getting-started.html#create-project
[5] http://syncope.apache.org/docs/getting-started.html#embedded-mode
[6] http://syncope.apache.org/docs/getting-started.html#moving-forward
[7] http://syncope.apache.org/docs/reference-guide.html#deployment-directories
[8] http://syncope.apache.org/docs/reference-guide.html#dbms
[9]https://www.tirasa.net/en/blog
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/