SOAP webservice app init fails with Unsupported protocol: https' - java

I have a SOAP webservice backend only application which fails to start(deploy) since March 30th with the error //Unsupported protocol: https'// (including the single quote next to https), no code change went in since an year or so and none of the other system URL's are configured within the application code or property file other than xlmns namespace uri in the XSD. I get that error during the application deployment (initialization) even before testing any webservice within the application.
I am on JDK 1.6.0.45 on a weblogic 10.3.6 server. (Sorry, I know I need to upgrade to newer, I will get there eventually I promise)
The full stacktrace is as below, I did enable ssl debug logs during weblogic start up but I do not see any error that would convey a missing certificate.
<Apr 5, 2022 2:31:49 PM IST> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection#0': Invocation of init method failed; nested exception is org.springframework.xml.xsd.commons.CommonsXsdSchemaException: Schema [ServletContext resource [/WEB-INF/xsd/AcmeAppGateway.xsd]] could not be loaded; nested exception is org.apache.ws.commons.schema.XmlSchemaException: Unsupported protocol: https'.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection#0': Invocation of init method failed; nested exception is org.springframework.xml.xsd.commons.CommonsXsdSchemaException: Schema [ServletContext resource [/WEB-INF/xsd/AcmeAppGateway.xsd]] could not be loaded; nested exception is org.apache.ws.commons.schema.XmlSchemaException: Unsupported protocol: https'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
Truncated. see log file for complete stacktrace
Caused By: org.springframework.xml.xsd.commons.CommonsXsdSchemaException: Schema [ServletContext resource [/WEB-INF/xsd/AcmeAppGateway.xsd]] could not be loaded; nested exception is org.apache.ws.commons.schema.XmlSchemaException: Unsupported protocol: https'
at org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection.afterPropertiesSet(CommonsXsdSchemaCollection.java:147)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
Truncated. see log file for complete stacktrace
Caused By: org.apache.ws.commons.schema.XmlSchemaException: Unsupported protocol: https'
at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:710)
at org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:706)
at org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:538)
at org.apache.ws.commons.schema.SchemaBuilder.handleSchemaElementChild(SchemaBuilder.java:1513)
at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:658)
Truncated. see log file for complete stacktrace
Caused By: java.net.ProtocolException: Unsupported protocol: https'
at weblogic.net.http.HttpClient.openServer(HttpClient.java:384)
at weblogic.net.http.HttpClient.New(HttpClient.java:252)
at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:213)
at weblogic.net.http.HttpURLConnection.followRedirect(HttpURLConnection.java:698)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:464)
Truncated. see log file for complete stacktrace
>
The xsd mentioned in the error has xlmns URI's as below, is it possible these are causing the problem by being on higher TLS version (TLS 1.2 which is not supported on JDK 1.6)?
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
There is no other URL configured in that xsd other than above. I came across another similiar error here, but that was due to a missing certificate. Much appreciated if anyone can point me in the right direction.

Okay finally figured out what the problem was after trial and error.
On our SOAP WS project we have set schemaLocation as below:
I believe* this site schemas.xmlsoap.org has turned on TLS1.2 on March 30th (*I am open to other reasons but this is my assumption at this time) which is why our application was working fine until that day and start to fail post that date. I verified the TLS configuration of that URL on SSLABS which said anything below TLS1.2 was disabled for that site.
Since I am still on JDK 1.6 there is no way to connect to this site which is on higher TLS than the one supported by 1.6, which is why the application initialization was failing while establishing connection to that url. The solution was to manually download the xml content of the soap encoding from the URL to a xml file and place this file within the project folder and then refer this file within the XSD for schemaLocation as shown below. This did the trick!!

Related

Websphere: No recipient has been provided on the MailMessage or the 'MailHeaders.TO' header

while trying to debug an API through Postman, deployed in IBm websphere Community Edition 3.x with JDK 1.6,
I am getting following error.
2017-04-26 16:14:57,779 ERROR [LoggingHandler] org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.integration.mail.MailSendingMessageHandler#3]; nested exception is java.lang.IllegalStateException: No recipient has been provided on the MailMessage or the 'MailHeaders.TO' header.
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:139)
at org.springframework.integration.dispatcher.BroadcastingDispatcher.invokeHandler(BroadcastingDispatcher.java:227)
at org.springframework.integration.dispatcher.BroadcastingDispatcher.access$000(BroadcastingDispatcher.java:51)
at org.springframework.integration.dispatcher.BroadcastingDispatcher$2.run(BroadcastingDispatcher.java:207)
at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:55)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalStateException: No recipient has been provided on the MailMessage or the 'MailHeaders.TO' header.
at org.springframework.util.Assert.state(Assert.java:392)
at org.springframework.integration.mail.MailSendingMessageHandler.applyHeadersToMailMessage(MailSendingMessageHandler.java:175)
at org.springframework.integration.mail.MailSendingMessageHandler.convertMessageToMailMessage(MailSendingMessageHandler.java:121)
at org.springframework.integration.mail.MailSendingMessageHandler.handleMessageInternal(MailSendingMessageHandler.java:77)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127)
... 7 more
API works fine with other environments but my local and Dev env.
One of the database was empty and after feeding related data, it got solved.

Using Pushy with ALPN and MSSQL Jdbc Driver throws java.lang.IllegalAccessError

I am developing an Application which uses Pushy with HTTP/2 access via ALPN to send Push Notifications to Apple iPhones.
For that I have configured the JVM to use ALPN as requested with the following VM Argument.
-Xbootclasspath/p:<Path To ALPN JAR>
This connection to Apple Push Notification Server works fine.
But In the same Application I have a MSSQL Datasource connecting to the Database via MSSQL Jdbc Driver. But when it tries to connect to the MSSQL it throws the following Error:
java.lang.IllegalAccessError: tried to access field sun.security.ssl.Handshaker.algorithmConstraints from class sun.security.ssl.ClientHandshaker
Can anyone help me with this or point me in the correct direction.
Full Stack Trace
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalAccessError: tried to access field sun.security.ssl.Handshaker.algorithmConstraints from class sun.security.ssl.ClientHandshaker
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 58 more
Caused by: java.lang.IllegalAccessError: tried to access field sun.security.ssl.Handshaker.algorithmConstraints from class sun.security.ssl.ClientHandshaker
at sun.security.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:778)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:285)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:969)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:904)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1050)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1618)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1323)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnectionInternal(SQLServerDataSource.java:621)
at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnection(SQLServerDataSource.java:57)
at com.zaxxer.hikari.pool.BaseHikariPool.addConnection(BaseHikariPool.java:373)
at com.zaxxer.hikari.pool.BaseHikariPool.initializeConnections(BaseHikariPool.java:469)
at com.zaxxer.hikari.pool.BaseHikariPool.<init>(BaseHikariPool.java:162)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:61)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:49)
at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:78)
Removing the VM Argument fixed the Datasource Issue but the ALPN connection fails.
UPDATE
Jetty's ALPN-Boot library will override the package sun.security.ssl
Which is also available in jsse.jar (Which means is a JVM core class)
This overriding makes the dataSource fail because MSSQL Server is not a HTTP2 Server
This is why I got
java.lang.IllegalAccessError: tried to access field sun.security.ssl.Handshaker.algorithmConstraints from class sun.security.ssl.ClientHandshaker
Is there anyway I could use Both HTTP2 and HTTP together?
I managed to get rid of this problem by using the jetty-alpn-agent

Errors when deploying Jar files to weblogic 12.1.3

This is the error log resulting from the exception. I'm not sure what causing it to fail during the deployments
2016-05-23 10:19:57,656 INFO [com.sdars.util.EJBUtil]: {java.naming.provider.url=t3:/localhost:7001, java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory, weblogic.jndi.enableServerAffinity=true}
2016-05-23 10:19:57,656 INFO [com.sdars.util.EJBUtil]: javax.naming.ConfigurationException: t3:/localhost:7001 [Root exception is java.net.MalformedURLException: t3:/localhost:7001]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:36)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:808)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:365)
at weblogic.jndi.Environment.getContext(Environment.java:319)
at weblogic.jndi.Environment.getContext(Environment.java:288)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.init(InitialContext.java:244)
at javax.naming.InitialContext.<init>(InitialContext.java:216)
Caused by: java.net.MalformedURLException: t3:/localhost:7001
at weblogic.protocol.ServerURL.parseURL(ServerURL.java:486)
at weblogic.protocol.ServerURL.<init>(ServerURL.java:104)
at weblogic.rjvm.ServerURL.<init>(ServerURL.java:49)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:335)
... 37 more
I believe that the error is due to trivial typo in java.naming.provider.url property value. Missing a / in the url.
Change from : t3:/localhost:7001
to : t3://localhost:7001
You may look at an example here from oracle's documentation.
Exception you are getting is
Root exception is java.net.MalformedURLException: t3:/localhost:7001. Standard weblogic url is of following format.
t3://ip:port
Looks like you are missing / in your url configuration
t3://localhost:7001

HTTP Status 503 on Sun Java System Application Server 9.1_02 (build b04-fcs)

We are replicating our Production application to our DR machine. Our application is a web app using Hibernate Spring and Struts2 framework running on a Sun Java System Application Server 9.1_02 (build b04-fcs). The application is stable on the production environment. Also made it to run during our first replications. Recently we encountered an HTTP Status 503.
We tried everything from redeployment to application server (servlet container) restart. We even tried rebuilding the application from source code and redeploying it just to resolve the http status 503. What could be causing this HTTP status 503?
Thanks in advance guys.
here are my dependencies/jar files
antlr-2.7.6.jar
arpeggio-1.1.jar
cglib-2.2.jar
commons-collections-3.1.jar
commons-dbcp-1.2.2.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.4.jar
commons-logging-1.1.1.jar
commons-pool-1.4.jar
dom4j-1.6.1.jar
freemarker-2.3.16.jar
ganymed-ssh2-build210.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate3.jar
javassist-3.12.0.GA.jar
jettison-1.3.2.jar
jta-1.1.jar
ldap.jar
log4j-1.2.14.jar
mime-util-2.1.3.jar
ognl-3.0.1.jar
oracle10g.jar
org.springframework.asm-3.0.6.RELEASE.jar
org.springframework.beans-3.0.6.RELEASE.jar
org.springframework.context-3.0.6.RELEASE.jar
org.springframework.core-3.0.6.RELEASE.jar
org.springframework.expression-3.0.6.RELEASE.jar
org.springframework.jdbc-3.0.6.RELEASE.jar
org.springframework.orm-3.0.6.RELEASE.jar
org.springframework.transaction-3.0.6.RELEASE.jar
org.springframework.web-3.0.6.RELEASE.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar
struts2-core-2.2.3.1.jar
struts2-json-plugin-2.2.3.1.jar
struts2-spring-plugin-2.2.3.1.jar
xwork-core-2.2.3.1.jar
Here is the application server logs
Log Entry Detail
Timestamp
Apr 25, 2013 17:03:12.981
Log Level
SEVERE
Logger
org.apache.catalina.core.StandardContext
Name-Value Pairs
_ThreadID=14;_ThreadName=pool-1-thread-7;_RequestID=d73c920a-2b6a-4f42-b523-93503d089b74;
Record Number
302
Message ID
PWC1306
Complete Message
Startup of context /myproject failed due to previous errors
Log Entry Detail
Timestamp
Apr 25, 2013 17:03:12.980
Log Level
SEVERE
Logger
javax.enterprise.system.container.web
Name-Value Pairs
_ThreadID=14;_ThreadName=pool-1-thread-7;_RequestID=d73c920a-2b6a-4f42-b523-93503d089b74;
Record Number
301
Message ID
WebModule[/myproject]PWC1275
Complete Message
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 'myprojectSessionFactory' defined in class path resource [hibernate-config/myproject-hibernate-spring.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax/persistence/OneToMany.orphanRemoval()Z at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4523) at org.apache.catalina.core.StandardContext.start(StandardContext.java:5184) at com.sun.enterprise.web.WebModule.start(WebModule.java:326) at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:58) at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:304) at com.sun.appserv.management.util.misc.RunnableBase.run(RunnableBase.java:341) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:284) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:678) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:703) at java.lang.Thread.run(Thread.java:811) Caused by: java.lang.NoSuchMethodError: javax/persistence/OneToMany.orphanRemoval()Z at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1912) at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:796) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:707) at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:4035) at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3989) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1398) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417) ... 24 more
Here's the big clue:
Caused by: java.lang.NoSuchMethodError:
javax/persistence/OneToMany.orphanRemoval()Z
It is saying that some code needs to call a method with signature boolean orphanRemoval() on the javax.persistence.OneToMany API ... but the version of the API that has just been loaded does not provide that methods.
In other words, you have a version mismatch between some of the JARs in the WAR file.
I don't think this is a mismatch between the hibernate and hibernate-jpa files because the JBoss Hibernate 3.x release zips have files with those names.
Instead, I think it is a mismatch between Hibernate and Spring. In particular, the Spring manual says:
Note: As of Spring 3.0, Spring requires Hibernate 3.2 or later.
It is not clear what version of Hibernate 3 you are using, but my theory is that it is too old for Spring 3.0.x.

JNDI lookup fails in Glassfish

I am working on a web project using maven.When I run the server on net-beans 6.8,the build is succes,but when deploying to server I am getting lookup failed exception.Please find the server log in the following url http://pastie.org/1997218. Let me know What I have missed here. The stack trace for the error is
SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'jdbc/deliver' in SerialContext [Root exception is javax.naming.NameNotFoundException: deliver not found]
at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init> (PersistenceUnitInfoImpl.java:111)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:130)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:96)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296)
...
As it seems your production server is missing the database resource jdbc/deliver your application needs. You have configured it properly for your test instance in NetBeans. Have a look at the Services tab in NetBeans and make sure you have a similar database set up on your server.

Categories