Protocol handler start failed Spring Boot SSL application - java

As soon as I add the SSL properties in spring boot my application does not run from command line.
Here is my properties file
#API Settings
server.port = 1180
## MULTIPART (MultipartProperties)
# Enable multipart uploads
spring.servlet.multipart.enabled=true
# Threshold after which files are written to disk.
spring.servlet.multipart.file-size-threshold=2KB
# Max file size.
spring.servlet.multipart.max-file-size=200MB
# Max Request Size
spring.servlet.multipart.max-request-size=215MB
## File Storage Properties
# All files uploaded through the REST API will be stored in this directory
file.upload-dir=D:/uploads
server.ssl.enabled=true
#Client
server.ssl.client-auth=need
server.ssl.key-store=D:\Symbox Staging Setup\SimulationAPI2waySLL\JKS\nt-ms.jks
server.ssl.key-store-password=kalsym
server.ssl.key-alias=nt-ms
server.ssl.key-store-type=JKS
server.ssl.trust-store=D:\Symbox Staging Setup\SimulationAPI2waySLL\JKS\nt-ms.jks
server.ssl.trust-store-password=kalsym
Here is my output

If anyone is still looking for solution, this stackoverflow.com/a/58602917/8719655 works. Thanks Carlos

Related

Elastic bean stalk entity too large error. how to fix this

I am working on a spring boot project and i am trying to add a file into S3 which is working fine in local but when i am doing it on beanstalk server its not working . I researched it and found that we can add .extensions in our file and add some config files but it still does not work for me . i have a file in .ebextensions/01_files.config
i have tried this:-
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000755"
owner: root
group: root
content: |
http {
client_max_body_size 2000M;
}
i have tried this
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000755"
owner: root
group: root
content: |
client_max_body_size 2000M;
i have tried this
container_commands:
01_reload_nginx:
command: "service nginx reload"
files:
"/etc/nginx/conf.d/proxy.conf":
mode: "000755"
owner: root
group: root
content: |
client_max_body_size 2000M;
but none of them has work
also i have a file in .ebextensions/nginx/conf.d
which is proxy.conf which contains
client_max_body_size 2000M;
I have application properties which look like this :
# ============ MULTIPART ==================
# Enable multipart uploads
spring.servlet.multipart.enabled=true
# Threshold after which files are written to disk.
spring.servlet.multipart.file-size-threshold=5MB
# Max file size.
spring.servlet.multipart.max-file-size=2000MB
# Max Request Size
spring.servlet.multipart.max-request-size=2000MB
spring.http.multipart.max-file-size=2000MB
spring.http.multipart.max-request-size=2000MB
upload_max_filesize=2000M
post_max_size=2000M
but none of them has work also
A likely reason is that you are using current version of EB environment which runs Amazon Linux 2 (AL2). However, the nginx file you are attempting to modify (/etc/nginx/conf.d/proxy.conf) is only for Amazon Linux 1 (AL1).
For AL2, nginx config files should be in .platform, not in .ebextensions as explained and exemplified in the AWS docs for AL2:
Reverse proxy configuration for AL2
You can try the following:
.platform/nginx/conf.d/myconf.conf with content of
http {
client_max_body_size 2000M;
}

AWS Elastic Beanstalk .ebextensions not updating the default configuration

I have a memory disk issue in my Elastic Beanstalk instance due to the log rotation so I am trying to modify the default configuration for log rotation by following the documentation:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html
After adding my config and rebuilding the environment, I can see my config (in the path which I specified) when I connect via SSH to my EB. However, it looks like my changes are not applied and logs don't rotate according to my config.
##################################################################
## Sets up the elastic beanstalk log publication to include
## the admin logs for cloudwatch logs
##################################################################
Resources:
AWSEBAutoScalingGroup:
Metadata:
"AWS::CloudFormation::Init":
configSets:
"_OnInstanceBoot":
"CmpFn::Insert":
values:
- EBCWLLogPublicationSetup
EBCWLLogPublicationSetup:
files:
"/etc/logrotate.elasticbeanstalk.hourly/logrotate.elasticbeanstalk.awslogs.conf":
content: |
/var/log/awslogs.log {
size 2M
rotate 3
missingok
compress
notifempty
copytruncate
dateext
dateformat %s
olddir /var/log/rotated
}
mode: "000644"
My EB instance contains a Java application (dropwizard, Java 1.8) which is dockerized.
Any idea?
Finally, I could find a different approach which works:
container_commands:
01-custom-rotate:
command: "/bin/sed -i 's/size 10M/size 7M/g' /etc/logrotate.elasticbeanstalk.hourly/logrotate.elasticbeanstalk.awslogs.conf"
Basically it replaces a text in the config file. The EB still needs to be rebuilt to see the changes.

ElasticBeanstalk - Changing java.security?

I would like to change the securerandom.source value in $JAVA_HOME/jre/lib/security/java.security on my Elastic Beanstalk instance.
How can I do that through the .ebextensions? Or is the another way to do that?
At the beginning of $JAVA_HOME/jre/lib/security/java.security file, there's a paragraph saying
# This is the "master security properties file".
#
# An alternate java.security properties file may be specified
# from the command line via the system property
#
# -Djava.security.properties=<URL>
#
# This properties file appends to the master security properties file.
# If both properties files specify values for the same key, the value
# from the command-line properties file is selected, as it is the last
# one loaded.
So you may create a java-security.config file with the following content under .ebextensions folder:
# Create a file named java-security under /usr/share/tomcat8/conf to override the default value of securerandom.source
files:
"/usr/share/tomcat8/conf/java-security" :
mode: "000755"
owner: tomcat
group: tomcat
content: |
securerandom.source=<the file you want for securerandom.source>
Then go to elastic beanstalk environment
-> Configuration
-> Software
-> Environment properties
-> type java.security.properties for Name, and /usr/share/tomcat8/conf/java-security for Value.
Then restart the tomcat. Your securerandom.source should be changed to the value you wish.
One thing to remember is that the user tomcat must have permissions to read /usr/share/tomcat8/conf/java-security file.

neo4j keeps giving erros and is not running,can you help me with its errors?

I downloaded neo4j.zip from its site and extract it.
I downloaded and installed jdk 7, I have two folders in :
C:\Program Files\Java\jdk1.7.0_75
and
C:\Program Files\Java\jre7
And I clicked on New and made a variable named JAVA_HOME and its value is
C:\Program Files\Java\jdk1.7.0_75
I have added
org.neo4j.server.startup_timeout=0
line to my neo4j-server.properties file because of timeout error and
I have changed the port number in neo4j-server.properties file from 7474 to 80 and 8085, this is my neo4j-server.properties now:
################################################################
# Neo4j
#
# neo4j-server.properties - runtime operational settings
#
################################################################
#***************************************************************
# Server configuration
#***************************************************************
# location of the database directory
org.neo4j.server.database.location=data/graph.db
# Low-level graph engine tuning file
org.neo4j.server.db.tuning.properties=conf/neo4j.properties
# Database mode
# Allowed values:
# HA - High Availability
# SINGLE - Single mode, default.
# To run in High Availability mode, configure the neo4j.properties config file, then uncomment this line:
#org.neo4j.server.database.mode=HA
# Let the webserver only listen on the specified IP. Default is localhost (only
# accept local connections). Uncomment to allow any connection. Please see the
# security section in the neo4j manual before modifying this.
#org.neo4j.server.webserver.address=0.0.0.0
# Require (or disable the requirement of) auth to access Neo4j
dbms.security.auth_enabled=true
#
# HTTP Connector
#
# http port (for all data, administrative, and UI access)
org.neo4j.server.webserver.port=8085
#
# HTTPS Connector
#
# Turn https-support on/off
org.neo4j.server.webserver.https.enabled=true
# https port (for all data, administrative, and UI access)
org.neo4j.server.webserver.https.port=7473
# Certificate location (auto generated if the file does not exist)
org.neo4j.server.webserver.https.cert.location=conf/ssl/snakeoil.cert
# Private key location (auto generated if the file does not exist)
org.neo4j.server.webserver.https.key.location=conf/ssl/snakeoil.key
# Internally generated keystore (don't try to put your own
# keystore there, it will get deleted when the server starts)
org.neo4j.server.webserver.https.keystore.location=data/keystore
# Comma separated list of JAX-RS packages containing JAX-RS resources, one
# package name for each mountpoint. The listed package names will be loaded
# under the mountpoints specified. Uncomment this line to mount the
# org.neo4j.examples.server.unmanaged.HelloWorldResource.java from
# neo4j-server-examples under /examples/unmanaged, resulting in a final URL of
# http://localhost:7474/examples/unmanaged/helloworld/{nodeId}
#org.neo4j.server.thirdparty_jaxrs_classes=org.neo4j.examples.server.unmanaged=/examples/unmanaged
#*****************************************************************
# HTTP logging configuration
#*****************************************************************
# HTTP logging is disabled. HTTP logging can be enabled by setting this
# property to 'true'.
org.neo4j.server.http.log.enabled=false
# Logging policy file that governs how HTTP log output is presented and
# archived. Note: changing the rollover and retention policy is sensible, but
# changing the output format is less so, since it is configured to use the
# ubiquitous common log format
org.neo4j.server.http.log.config=conf/neo4j-http-logging.xml
#*****************************************************************
# Administration client configuration
#*****************************************************************
# location of the servers round-robin database directory. possible values:
# - absolute path like /var/rrd
# - path relative to the server working directory like data/rrd
# - commented out, will default to the database data directory.
org.neo4j.server.webadmin.rrdb.location=data/rrd
org.neo4j.server.startup_timeout=0
but again when I run Neo4j.bat by double clicking on it, cmd window will open and java window will open and will close after some seconds and cmd window will close after it and
http://localhost:8085/browser/
is unavailable.
This is my error from
C:\Users\Fereshteh\Desktop\neo4j-enterprise-2.2.0-windows\neo4j-enterprise-2.2.0\data\graph.db\messages
2015-04-10 01:56:42.689+0000 ERROR [o.n.s.e.EnterpriseBootstrapper]: Failed to start Neo Server on port [8085]
org.neo4j.server.ServerStartupException: Starting Neo4j Server failed: Wanted record LOG_VERSION, but this record wasn't read since the neostore didn't contain it
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:255) ~[neo4j-server-2.2.0.jar:2.2.0]
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:117) [neo4j-server-2.2.0.jar:2.2.0]
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:69) [neo4j-server-2.2.0.jar:2.2.0]
Caused by: java.lang.IllegalStateException: Wanted record LOG_VERSION, but this record wasn't read since the neostore didn't contain it
at org.neo4j.kernel.impl.store.record.NeoStoreUtil.getValue(NeoStoreUtil.java:127) ~[neo4j-kernel-2.2.0.jar:2.2.0]
at org.neo4j.kernel.impl.store.record.NeoStoreUtil.getLogVersion(NeoStoreUtil.java:150) ~[neo4j-kernel-2.2.0.jar:2.2.0]
at org.neo4j.kernel.impl.recovery.StoreRecoverer.recoveryNeededAt(StoreRecoverer.java:57) ~[neo4j-kernel-2.2.0.jar:2.2.0]
at org.neo4j.server.preflight.PerformRecoveryIfNecessary.run(PerformRecoveryIfNecessary.java:62) ~[neo4j-server-2.2.0.jar:2.2.0]
at org.neo4j.server.preflight.PreFlightTasks.run(PreFlightTasks.java:71) ~[neo4j-server-2.2.0.jar:2.2.0]
at org.neo4j.server.AbstractNeoServer.runPreflightTasks(AbstractNeoServer.java:387) ~[neo4j-server-2.2.0.jar:2.2.0]
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:195) ~[neo4j-server-2.2.0.jar:2.2.0]
And in my C:\Users\Fereshteh\Desktop\neo4j-enterprise-2.2.0-windows\neo4j-enterprise-2.2.0\data\log
I have just README and windows-wrapper.0.0.txt and windows-wrapper.0.0.log.lck
what should I do to be able to run Neo4j and work with it?
I have windows 7 x86
thanks in advance.
I had the same error today. In my case, it was because the files in the database directory were corrupted (I unzipped an existing graph which failed on first try). After I unzipped the existing graph database correctly - and the database files were fine - it worked. So, maybe your database directory is also corrupted.
Move the neo4j folder to another directory -> \Program'thisblankisbad'Files\ <- was the cause for me. I was trying to reinstall the service on Windows with
neo4j install-service
and neo4j threw:
neo4j Error: mainclass org.neo4j.server.startup.Neo4jCommand could not be found or loaded cause: java.lang.ClassNotFoundException: org.neo4j.server.startup.Neo4jCommand
after i moved the neo4j folder to another directory (NO BLANKS!!!) it was fine
windows 10, neo4j v4.4.9

neo4j 2.1 not creating node but running successfully

I'am using debian distribution.I write a code in windows but I have no error and I create a database.Despite I prepare libraries in Debian, my database is not created and data is not added and in java program there was no error.
My Database Path.
dbPath=/var/lib/neo4j/data/graph.db
I guess error occurs about database proporties.
I have 2 different proporties so I don't know how can I set this settings.
-etc/neo4j
-/var/lib/neo4j/conf
You should have the /etc/neo4j/neo4j-server.properties file that typically begins like
################################################################
# Neo4j configuration
#
################################################################
#***************************************************************
# Server configuration
#***************************************************************
# location of the database directory
org.neo4j.server.database.location=data/graph.db
...
...
Where database path is relative.
If you want to have an absolute path, you should have this line:
org.neo4j.server.database.location=/var/lib/neo4j/data/graph.db

Categories

Resources