[SOLVED] Can not Start Local Server on Win8.1

I am too getting the same error “C:\Users\Shivasiddharth\Blynk Server>java -jar server-0.15.2.jar -dataFolder /path Server ports are busy. Most probably server already launched. See C:\Users\Shivasiddharth\Blynk Server.\logs for more info.”

But when i try to connect the app to the server it says, user not registered. And my log file looks like something below.

12:01:03.911 INFO - Using data dir ‘\path’
12:01:04.045 INFO - Initializing mail transport. Username : ushivasiddharth@gmail.com. SMTP host : smtp.gmail.com:587
12:01:04.731 INFO - Plain tcp/ip hardware server port 8442.
12:01:04.733 WARN - ATTENTION. Certificate C:\Users\Shivasiddharth\Blynk Server and key C:\Users\Shivasiddharth\Blynk Server paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
12:01:05.611 INFO - SSL hardware port 8441.
12:01:05.616 WARN - ATTENTION. Server certificate paths cert : ‘C:\Users\Shivasiddharth\Blynk Server’, key : ‘C:\Users\Shivasiddharth\Blynk Server’ - not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
12:01:05.805 INFO - Application server port 8443.
12:01:05.825 INFO - HTTP API port 8080.
12:01:05.827 WARN - ATTENTION. Certificate C:\Users\Shivasiddharth\Blynk Server and key C:\Users\Shivasiddharth\Blynk Server paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
12:01:06.189 INFO - HTTPS API port 9443.
12:01:06.198 WARN - ATTENTION. Certificate C:\Users\Shivasiddharth\Blynk Server and key C:\Users\Shivasiddharth\Blynk Server paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
12:01:06.393 INFO - HTTPS admin UI port 7443.
12:01:06.650 INFO - HTTP reset pass port 7444.
12:01:06.651 INFO - Web Sockets port 8082.
12:01:06.651 WARN - ATTENTION. Certificate C:\Users\Shivasiddharth\Blynk Server and key C:\Users\Shivasiddharth\Blynk Server paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
12:01:06.968 INFO - Web SSL Sockets port 8081.
12:01:07.233 ERROR - Error initializing HTTP API, port 8080
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Unknown Source)
at sun.nio.ch.Net.bind(Unknown Source)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:498)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1271)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:413)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:399)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:1019)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:198)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:349)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Unknown Source)
12:01:49.889 ERROR - User not registered. Username ‘ushivasiddharth@gmail.com’, /10.4.100.31:62913

PS: My firewall is disabled. I am using my university internet.

You already have running server. You need to stop it if you want to run it again.

There is no java process running. I checked it in the task manager.

In that case something else is using 8080 port. Either find it and close, either change 8080 port to something else via server.properties file as described in instruction.

thanks a lot. I changed it to port 80 and it started working

1 Like

Now when i try to login from my android app it says something went wrong. the ip that i have assigned in the app is the ip4 of my internet. and port i have given 8443. Kindly excuse my lack of knowledge.

You need to put IP in app. of machine where your server is (in case both app and server within one network).

IPv4 Address. . . . . . . . . . . : 10.4.100.31(Preferred) this is what i saw by giving “ipconfig /all”

ANd i have entered the same thing app also.

How does your app connect to internet?

I have an ethernet connection connected to the laptop. and i am sharing the ethernet connection to my app through virtual router/ soft acces point

I am getting user unregistered as well… Kindly help

On local server? That’s ok, as for local server you have to create separate account.

OMG how did i really miss this… Instead of signing up separately with custom server, i was trying to login using the blynk server credentials… Thanks a lot for your guidance and support. Now i have got it working.

i have given acess to all the app in google account settings.but i have not received auth tokens i have configured the mail.properties file as below:

mail.smtp.auth=true
mail.smtp.starttls.enable=true
mail.smtp.host=smtp.gmail.com
mail.smtp.port=587
mail.smtp.username=gmail id
mail.smtp.password=gmailpassword

my log file looks like this:

02:51:22.892 ERROR - Error sending email from application. For user ushivasiddharth@gmail.com.
javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2046)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:711)
at javax.mail.Service.connect(Service.java:388)
at javax.mail.Service.connect(Service.java:246)
at javax.mail.Service.connect(Service.java:195)
at javax.mail.Transport.send0(Transport.java:254)
at javax.mail.Transport.send(Transport.java:124)
at cc.blynk.server.notifications.mail.MailWrapper.send(MailWrapper.java:60)
at cc.blynk.server.notifications.mail.MailWrapper.send(MailWrapper.java:46)
at cc.blynk.server.application.handlers.main.logic.AppMailLogic.lambda$mail$0(AppMailLogic.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:598)
at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:525)
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2041)
… 12 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)
… 22 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
… 28 more

Did you read this in the documentation:

NOTE: you’ll need to setup Gmail to allow less secured applications. Go here and then click “Allow less secure apps”.

It’s needed for gmail :slight_smile:

Hm… It seems like another issue. Never saw it before. I’ll investigate.

I have done that. Its something else… i will try installing certificates.

@shivasiddharth could you please try to run jar with one more option -Djavax.net.ssl.trustStore

java -Djavax.net.ssl.trustStore -jar server.jar -dataFolder path

Still the same error. The log still looks the same:

Error sending email from application. For user ushivasiddharth@gmail.com.
javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2046)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:711)
at javax.mail.Service.connect(Service.java:388)
at javax.mail.Service.connect(Service.java:246)
at javax.mail.Service.connect(Service.java:195)
at javax.mail.Transport.send0(Transport.java:254)
at javax.mail.Transport.send(Transport.java:124)
at cc.blynk.server.notifications.mail.MailWrapper.send(MailWrapper.java:60)
at cc.blynk.server.notifications.mail.MailWrapper.send(MailWrapper.java:46)
at cc.blynk.server.application.handlers.main.logic.AppMailLogic.lambda$mail$0(AppMailLogic.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:598)
at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:525)
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2041)
… 12 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)
… 22 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
… 28 more

Finally figured it out. My avast antivirus was preventing the mail from being sent. I disabled it and it started working. thanks a lot for your support.

1 Like