Unable to load: custom OracleValidConnectionChecker - jboss

<validation>
<valid-connection-checker class-name="com.rolfeandnolan.merlin.fmextensions.FMOracleValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>
<exception-sorter class-name="com.rolfeandnolan.merlin.fmextensions.FMOracleExceptionSorter"/>
</validation>
FMOracleValidConnectionChecker is custom OracleValidationConnectionChecker. It's working fine in wildfly 10 but giving below stacktrace in wildfly 20
java:/com/rolfeandnolan/merlin/datasources/NonTransactional: java.lang.Exception: Unable to load: com.rolfeandnolan.merlin.fmextensions.FMOracleValidConnectionChecker
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory.loadPlugin(BaseWrapperManagedConnectionFactory.java:1215)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:1292)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory.getInvalidConnections(BaseWrapperManagedConnectionFactory.java:1098)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.getConnection(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:379)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:632)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:604)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:624)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:597)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:789)
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:151)
at org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:64)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
at org.hibernate.internal.SessionFactoryImpl$1.obtainConnection(SessionFactoryImpl.java:460)
at org.hibernate.hql.spi.id.IdTableHelper.executeIdTableCreationStatements(IdTableHelper.java:67)
at org.hibernate.hql.spi.id.global.GlobalTemporaryTableBulkIdStrategy.finishPreparation(GlobalTemporaryTableBulkIdStrategy.java:125)
at org.hibernate.hql.spi.id.global.GlobalTemporaryTableBulkIdStrategy.finishPreparation(GlobalTemporaryTableBulkIdStrategy.java:42)
at org.hibernate.hql.spi.id.AbstractMultiTableBulkIdStrategyImpl.prepare(AbstractMultiTableBulkIdStrategyImpl.java:88)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:303)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1250)
at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:170)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:128)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:658)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:212)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Wildfly version 20
ojdbc version 8.0
Does anybody know how can I fix this problem?
Project structure -
Application.ear>-lib>-utility.jar
-META-INF
-EJB.jar
-.war

I think that the required classes should be in the "org.jboss.ironjacamar.jdbcadapters" module: so you need to add your jar there and add it to the module.xml

Related

OrientDB compatibility with Java17

We are using OrientDB 3.0.10 version and we are planning to migrate our application from Java11 to Java17. But application is stopped working due to OrientDB exception. On the latest version of OrientDB also same issue exists.
22-Mar-2022 12:35:15.140 ERROR [Catalina-utility-1] o.a.catalina.core.StandardContext.listenerStart - Exception sending context initialized event to listener instance of class [com.progress.fathom.servlet.FathomContextInitializer]
java.lang.ExceptionInInitializerError: null
at javassist.util.proxy.DefineClassHelper.<clinit>(DefineClassHelper.java:216)
at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:128)
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:552)
at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:537)
at javassist.util.proxy.ProxyFactory.createClass1(ProxyFactory.java:473)
at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:444)
at com.orientechnologies.orient.object.enhancement.OObjectEntityEnhancer.getProxiedInstance(OObjectEntityEnhancer.java:97)
at com.orientechnologies.orient.object.db.OObjectDatabaseTx.newInstance(OObjectDatabaseTx.java:211)
at com.orientechnologies.orient.object.db.OObjectDatabaseTx.newInstance(OObjectDatabaseTx.java:115)
at com.orientechnologies.orient.object.enhancement.OObjectEntitySerializer.serializeObject(OObjectEntitySerializer.java:146)
at com.orientechnologies.orient.object.db.OObjectDatabaseTx.save(OObjectDatabaseTx.java:499)
at com.orientechnologies.orient.object.db.OObjectDatabaseTx.save(OObjectDatabaseTx.java:444)
at com.progress.isq.ipqos.AbstractDatabase.updateDatabaseSchemaVersion(AbstractDatabase.java:455)
at com.progress.isq.ipqos.AbstractDatabase.checkAndUpdateSchema(AbstractDatabase.java:481)
at com.progress.isq.ipqos.AbstractDatabase.applySchema(AbstractDatabase.java:399)
at com.progress.isq.ipqos.AbstractDatabase.openDatabase(AbstractDatabase.java:374)
at com.progress.isq.ipqos.AbstractDatabase.open(AbstractDatabase.java:296)
at com.progress.isq.ipqos.Probe.loadProject(Probe.java:1817)
at com.progress.isq.ipqos.Probe.loadAndInitializeProjectResources(Probe.java:1195)
at com.progress.isq.ipqos.Probe.createAndInitializeBaselineResources(Probe.java:678)
at com.progress.isq.ipqos.Probe.start(Probe.java:391)
at com.progress.fathom.servlet.FathomContextInitializer.contextInitialized(FathomContextInitializer.java:298)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module #46762e3e
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at javassist.util.proxy.SecurityActions$3.run(SecurityActions.java:94)
at javassist.util.proxy.SecurityActions$3.run(SecurityActions.java:90)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at javassist.util.proxy.SecurityActions.getMethodHandle(SecurityActions.java:89)
at javassist.util.proxy.DefineClassHelper$SecuredPrivileged$2.getDefineClassMethodHandle(DefineClassHelper.java:143)
at javassist.util.proxy.DefineClassHelper$SecuredPrivileged$2.<init>(DefineClassHelper.java:136)
at javassist.util.proxy.DefineClassHelper$SecuredPrivileged.<clinit>(DefineClassHelper.java:134)
... 52 common frames omitted
To fix this we have added --add-opens=java.base/java.lang=ALL-UNNAMED to our application as mitigation but we know that this is not the valid fix for the issue. OrientDB needs to come up with a fix i think.
Another thing is OrientDB already added other java packages to Add-Opens in orient jar manifest file
Manifest-Version: 1.0
Implementation-Title: OrientDB Object
Implementation-Version: 3.2.5
Built-By: tglman
Specification-Vendor: Orient Technologies
Specification-Title: OrientDB Object
Implementation-Vendor-Id: com.orientechnologies
Implementation-Vendor: Orient Technologies
Implementation-Build-Date: 2022-02-14 18:19:43+0000
Add-Opens: jdk.unsupported/sun.misc=ALL-UNNAMED java.base/sun.security
.x509=ALL-UNNAMED
X-Compile-Target-JDK: 8
Implementation-Build: c4298657c01683192ba0b7bfffdf82226c164506
X-Compile-Source-JDK: 8
Created-By: Apache Maven 3.6.3
Build-Jdk: 1.8.0_312
Specification-Version: 3.2
Implementation-URL: http://www.orientechnologies.com
Is OrientDB officially supporting Java17 and is there any plan to fix this issue?

JBoss Fuse Hello World - Missing Manifest issue

I'm trying to follow the steps outlined in the hello world program for Red Hat JBoss Fuse: https://developers.redhat.com/products/fuse/hello-world/
When I go to deploy the bundle I get an error message "Unable to retrieve the bundle details for deployment. Possible reason is a missing or invalid Manifest."
Does anyone have any idea what I'm doing incorrectly?
Here's the trace I get from the pom.xml:
org.apache.maven.plugin.MojoExecutionException: Internal error in
maven-bundle-plugin
at org.apache.felix.bundleplugin.ManifestPlugin.execute(ManifestPlugin.java:119)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:387)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:378)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360)
at org.sonatype.tycho.m2e.felix.internal.MavenBundlePluginConfigurator$1.build(MavenBundlePluginConfigurator.java:125)
at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.IllegalStateException: Calc manifest failed,
state=
{pom.id=com.mycompany:camel-blueprint-cbr:bundle:1.0.0-SNAPSHOT,
file.encoding.pkg=sun.io,
org.osgi.framework.executionenvironment=OSGi/Minimum-1.0,OSGi/Minimum-1.1,OSGi/Minimum-1.2,JavaSE/compact1-1.8,JavaSE/compact2-1.8,JavaSE/compact3-1.8,JRE-1.1,J2SE-1.2,J2SE-1.3,J2SE-1.4,J2SE-1.5,JavaSE-1.6,JavaSE-1.7,JavaSE-1.8,
env.PROMPT=$P$G,
osgi.framework=file:/c:/Users/z1234567/devstudio/studio/plugins/org.eclipse.osgi_3.11.3.v20170209-1843.jar,
version.maven-bundle-plugin=3.2.0, java.home=C:\Program
Files\Java\jdk1.8.0_121\jre,
eclipse.application=org.eclipse.ui.ide.workbench, pom.contributors=[],
org.eclipse.debug.ui.breakpoints.toggleFactoriesUsed=true,
project.build.developers=[], project.description=Camel Content-Based
Router Example,
pom.pomFile=C:\Users\z1234567\JBOSS_studio_workspace\fuse-camel-cbr\pom.xml,
java.endorsed.dirs=C:\Program
Files\Java\jdk1.8.0_121\jre\lib\endorsed,
project.build.groupId=com.mycompany, env.USERNAME=z1234567,
sun.os.patch.level=Service Pack 1,
java.vendor.url=*******java.oracle.com/, env.COMPUTERNAME=AAAAAAAB,
env.=C:=C:\Users\z1234567\devstudio, pom.profiles=[],
maven-symbolicname=com.mycompany.camel-blueprint-cbr,
java.version=1.8.0_121,
osgi.compatibility.bootdelegation.default=true, osgi.os=win32,
osgi.compatibility.bootdelegation=true,
...
based on the error that is provided, it seems that you hit a bug in Tycho m2e integration with maven-bundle-plugin (a bug which was reported for sure but that i'm not able to find again)
A workaround which is working most of the time consists in refreshing the Maven project (Alt+F5)
regards,

javax.servlet.ServletException: Possible CSRF attack. Refer header :

I am using two WSO2 Identity Server for back-end and Apache HTTP as front-end Load Balancer
When testing the browser the URL https://lab1.xx.xx/dashboard, I see the following error at the WSO2 console log:
TID: [0] [IS] [2015-09-10 16:59:22,846] ERROR {org.wso2.carbon.tomcat.ext.valves.CompositeValve} - Could not handle request: /portal/gadgets/user_profile/js/main.js {org.wso2.carbon.tomcat.ext.valves.CompositeValve}
javax.servlet.ServletException: Possible CSRF attack. Refer header : https://lab1.xx.xx/dashboard/
at org.wso2.carbon.ui.valve.CSRFValve.validateRefererHeader(CSRFValve.java:123)
at org.wso2.carbon.ui.valve.CSRFValve.validatePatterns(CSRFValve.java:96)
at org.wso2.carbon.ui.valve.CSRFValve.invoke(CSRFValve.java:71)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57)
at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1695)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
I applied the Patch ID: WSO2-CARBON-PATCH-4.2.0-1256 and WSO2-IS-5.0.0-SP01
<CSRFPreventionConfig>
<Enabled>true</Enabled>
<Rule>allow</Rule>
<Patterns>
<Pattern>carbon</Pattern>
<Pattern>commonauth</Pattern>
<Pattern>samlsso</Pattern>
<Pattern>authenticationendpoint</Pattern>
<Pattern>wso2</Pattern>
<Pattern>oauth2</Pattern>
<Pattern>openid</Pattern>
<Pattern>openidserver</Pattern>
<Pattern>passivests</Pattern>
<Pattern>services</Pattern>
</Patterns>
<WhiteList>
<Url>https://localhost:9443</Url>
</WhiteList>
</CSRFPreventionConfig>
Any hint how to setup a CSRF Whitelist?
Regards, Raybar
Change your /repository/conf/carbon.xml file and on WhiteList element add the Url element with the text https://lab1.xx.xx.
After changing that part must appears something like:
<WhiteList>
<Url>https://localhost:9443</Url>
<Url>https://lab1.xx.xx</Url>
</WhiteList>
I add in the whitelist, but does not work, I still see the same error log.
it might be added somewhere else?
my /repository/conf/carbon.xml file:
<CSRFPreventionConfig>
<Enabled>false</Enabled>
<Rule>allow</Rule>
<Patterns>
<Pattern>carbon</Pattern>
<Pattern>commonauth</Pattern>
<Pattern>samlsso</Pattern>
<Pattern>authenticationendpoint</Pattern>
<Pattern>wso2</Pattern>
<Pattern>oauth2</Pattern>
<Pattern>openid</Pattern>
<Pattern>openidserver</Pattern>
<Pattern>passivests</Pattern>
<Pattern>services</Pattern>
<Pattern>dashboard</Pattern>
</Patterns>
<WhiteList>
<Url>https://localhost:9443</Url>
<Url>https://ssohalab2.xx.xx:9443</Url>
<Url>https://lab1.xx.xx/dashboard/*</Url>
</WhiteList>
</CSRFPreventionConfig>
https://ssohalab2.xx.xx:9443 ---> SSO Server
https://lab1.xx.xx/dashboard/* ---> Reverse Proxy
Regards, Raybar

Failed to execute goal tomcat:deploy Error writing to server

I'm trying to test a spring-mvc tutorial here.
I would like to deploy the generated war on tomcat 7 using eclipse-maven.
The war works fine when deployed manually on tomcat.
Steps to follow :
import project on eclipse
add this plugin to the existing POM:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<mode>war</mode>
<url>http://localhost:8080/manager/html/</url>
<server>TomcatServer</server>
<path>/springexample</path>
</configuration>
configure a new tomcat server in eclipse with the name TomcatServer
modify the tomcat-users.xml file:
include an admin user:
<tomcat-users>
<role rolename="admin"/>
<role rolename="standard"/>
<role rolename="manager-gui"/>
<role rolename="manager"/>
<role rolename="tomcat"/>
<role rolename="manager-script"/>
<user password="password" roles="standard,manager,admin,manager-gui,manager-script,tomcat" username="admin"/>
</tomcat-users>
Add the server configuration to the setting.xml config file under .m2
user folder:
TomcatServer
admin
password
Strat tomcat server
When I execute the following goals :
Maven generate-sources : to generate the war file
then Run configuration --> with the goal :
tomcat:deploy
the error is :
[
ERROR] Failed to execute goal
org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on
project springexample: Cannot invoke Tomcat manager: Error writing to
server -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy
(default-cli) on project springexample: Cannot invoke Tomcat manager
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at
org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot
invoke Tomcat manager at
org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:149)
at
org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:70)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more Caused by: java.io.IOException: Error writing to server
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source) at
org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:604)
at
org.codehaus.mojo.tomcat.TomcatManager.deployImpl(TomcatManager.java:662)
at
org.codehaus.mojo.tomcat.TomcatManager.deploy(TomcatManager.java:295)
at
org.codehaus.mojo.tomcat.AbstractDeployWarMojo.deployWar(AbstractDeployWarMojo.java:85)
at
org.codehaus.mojo.tomcat.AbstractDeployMojo.invokeManager(AbstractDeployMojo.java:85)
at
org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:141)
... 22 more [ERROR] [ERROR] [ERROR] For more information about the
errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
In my case, using the tomcat7 command for deployment worked :
tomcat7:deploy
And you should not use :
tomcat:deploy
My issue was related to the fact the WAR file was over 50mb. You need to set the config in web.xml from the tomcat manager.
The file will normally be in %tomcat installation%\webapps\manager\WEB-INF\web.xml
<multipart-config>
<!-- 50MB max -->
<max-file-size>52428800</max-file-size>
<max-request-size>52428800</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config>
You should focus your effors on
Caused by: java.io.IOException: Error writing to server
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:604)
Look at the source for TomcatManager (http://mojo.codehaus.org/tomcat-maven-plugin/xref/org/codehaus/mojo/tomcat/TomcatManager.html#672)
The maven plugin cannot read from the server. It connects, line 597, it writes the data, line 601, but fails when it reads the response, line 604
I would try to deploy at the server first (to get rid of network problems) and see if the problem persists.

javax.servlet.ServletException: java.lang.VerifyError: createELResolver signature

I am struggling with the following issue and help to resolve it would be greatly appreciated.
I am developing an application and have been running it in Tomcat 7.0.19 installed locally on my machine. Everything was working fine until today when I deployed it on the dev server which has Tomcat 7.0.14 installed on it. I get the following issue when I open my application on the Dev server.
javax.servlet.ServletException: java.lang.VerifyError: (class: org/apache/jasper/runtime/JspApplicationContextImpl, method: createELResolver signature: ()Ljavax/el/ELResolver;) Incompatible argument to function
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:342)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
with root cause
java.lang.VerifyError: (class: org/apache/jasper/runtime/JspApplicationContextImpl, method: createELResolver signature: ()Ljavax/el/ELResolver;) Incompatible argument to function
org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:220)
org.apache.jsp.WEB_002dINF.views.login_jsp._jspInit(login_jsp.java:28)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:171)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
Please let me know.
Remove all Tomcat-specific libraries like el-api.jar from your webapp's /WEB-INF/lib folder. It will make your webapp incompatible with containers of a different make/version resulting in this kind of errors.
See also:
How do I import the javax.servlet API in my Eclipse project?