[JBoss JIRA] (JBJCA-1380) XAManagedConnectionFactory screws up Datasource urls containing ;
by Yannick Einsweiler (Jira)
[ https://issues.jboss.org/browse/JBJCA-1380?page=com.atlassian.jira.plugin... ]
Yannick Einsweiler commented on JBJCA-1380:
-------------------------------------------
[~chrispoulsen] same here. Not sure why semicolon was replaced in the first place. If someone wanted to have separate properties, that's what `xa-datasource-property` is there for.
No real workaround as `org.h2.jdbcx.JdbcDataSource` class as no other setters and uses hardcoded semicolon to parse/split the URL string. We ended up commenting out that replacement line in a custom class.
The fix in my mind would be to check if URL is h2-related and if it is, do not replace semicolons. There could be however other dbms.
> XAManagedConnectionFactory screws up Datasource urls containing ;
> -----------------------------------------------------------------
>
> Key: JBJCA-1380
> URL: https://issues.jboss.org/browse/JBJCA-1380
> Project: IronJacamar
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 1.4.9
> Environment: Unit testing using an embedded ironjacamar
> Reporter: Chris Poulsen
> Priority: Major
> Attachments: XAManagedConnectionFactory-h2-error.txt
>
>
> While trying to adjust settings on the H2 data source we use for a corner of our system during testing, I ran into problems.
> H2 accepts parameters appended to the url on the form ";<name>=<value>" for example:
> "jdbc:h2:mem:unit-test;MODE=Oracle"
> I was unable to deploy the datasource using:
> <xa-datasource-property name="url">jdbc:h2:mem:unit-test;MODE=Oracle</xa-datasource-property>
> Ironjacamar keeps complaining about:
> Caused by: java.lang.NoSuchMethodException: Method setMODE not found some setter not being found.
> My initial thought was that <url-delimiter> was the cause, but no dice.
> Following the trace into the sources, I guess the offending line is:
> {code:java}
> xaDataSourceProperties = xaDataSourceProperties.replace(';', '\n');
> {code}
> In XAManagedConnectionFactory around line: 174 (see following snippet)
> {code:java}
> public void setXADataSourceProperties(String xaDataSourceProperties) throws ResourceException
> {
> this.xaDataSourceProperties = xaDataSourceProperties;
> xaProps.clear();
> if (xaDataSourceProperties != null)
> {
> // Map any \ to \\
> xaDataSourceProperties = xaDataSourceProperties.replaceAll("\\\\", "\\\\\\\\");
> // Map any ; to \n
> xaDataSourceProperties = xaDataSourceProperties.replace(';', '\n');
> InputStream is = new ByteArrayInputStream(xaDataSourceProperties.getBytes());
> try
> {
> Properties p = new Properties();
> p.load(is);
> for (Map.Entry<Object, Object> entry : p.entrySet())
> {
> xaProps.put((String)entry.getKey(), (String)entry.getValue());
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 7 months
[JBoss JIRA] (WFLY-11411) ModuleClassLoader fails with ClassNotFoundException when class in a jar file
by Yeray Borges (Jira)
[ https://issues.jboss.org/browse/WFLY-11411?page=com.atlassian.jira.plugin... ]
Yeray Borges resolved WFLY-11411.
---------------------------------
Resolution: Rejected
> ModuleClassLoader fails with ClassNotFoundException when class in a jar file
> ----------------------------------------------------------------------------
>
> Key: WFLY-11411
> URL: https://issues.jboss.org/browse/WFLY-11411
> Project: WildFly
> Issue Type: Bug
> Components: Class Loading
> Affects Versions: 11.0.0.Final, 14.0.0.Final
> Environment: Wildfly 11, 14, Java 1.8, Windows 10
> Reporter: Karl Nicholas
> Assignee: Yeray Borges
> Priority: Major
> Attachments: JaxRsActivator.java, RestSever.java
>
>
> Simple REST service with Application activator in project and Rest Server in another project with jar file fails to load.
> Works okay with EAR project structure but not with simpler WAR project structure.
> Caused by: java.lang.ClassNotFoundException: rest.service.server.RestSever from [Module "deployment.restserver7.war" from Service Module Loader]
> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
> at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 7 months
[JBoss JIRA] (WFLY-11411) ModuleClassLoader fails with ClassNotFoundException when class in a jar file
by Yeray Borges (Jira)
[ https://issues.jboss.org/browse/WFLY-11411?page=com.atlassian.jira.plugin... ]
Yeray Borges closed WFLY-11411.
-------------------------------
> ModuleClassLoader fails with ClassNotFoundException when class in a jar file
> ----------------------------------------------------------------------------
>
> Key: WFLY-11411
> URL: https://issues.jboss.org/browse/WFLY-11411
> Project: WildFly
> Issue Type: Bug
> Components: Class Loading
> Affects Versions: 11.0.0.Final, 14.0.0.Final
> Environment: Wildfly 11, 14, Java 1.8, Windows 10
> Reporter: Karl Nicholas
> Assignee: Yeray Borges
> Priority: Major
> Attachments: JaxRsActivator.java, RestSever.java
>
>
> Simple REST service with Application activator in project and Rest Server in another project with jar file fails to load.
> Works okay with EAR project structure but not with simpler WAR project structure.
> Caused by: java.lang.ClassNotFoundException: rest.service.server.RestSever from [Module "deployment.restserver7.war" from Service Module Loader]
> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
> at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 7 months
[JBoss JIRA] (WFLY-11411) ModuleClassLoader fails with ClassNotFoundException when class in a jar file
by Karl Nicholas (Jira)
[ https://issues.jboss.org/browse/WFLY-11411?page=com.atlassian.jira.plugin... ]
Karl Nicholas edited comment on WFLY-11411 at 11/26/18 10:24 AM:
-----------------------------------------------------------------
Yes, agreed, something strange on my side. Cannot reproduce. Please close.
was (Author: karlnicholas):
Yes, agreed, something had been configured incorrectly on my side. I think I was tripped up with the version numbers being in the deployment path. Please close.
> ModuleClassLoader fails with ClassNotFoundException when class in a jar file
> ----------------------------------------------------------------------------
>
> Key: WFLY-11411
> URL: https://issues.jboss.org/browse/WFLY-11411
> Project: WildFly
> Issue Type: Bug
> Components: Class Loading
> Affects Versions: 11.0.0.Final, 14.0.0.Final
> Environment: Wildfly 11, 14, Java 1.8, Windows 10
> Reporter: Karl Nicholas
> Assignee: Yeray Borges
> Priority: Major
> Attachments: JaxRsActivator.java, RestSever.java
>
>
> Simple REST service with Application activator in project and Rest Server in another project with jar file fails to load.
> Works okay with EAR project structure but not with simpler WAR project structure.
> Caused by: java.lang.ClassNotFoundException: rest.service.server.RestSever from [Module "deployment.restserver7.war" from Service Module Loader]
> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
> at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 7 months
[JBoss JIRA] (WFLY-11411) ModuleClassLoader fails with ClassNotFoundException when class in a jar file
by Karl Nicholas (Jira)
[ https://issues.jboss.org/browse/WFLY-11411?page=com.atlassian.jira.plugin... ]
Karl Nicholas commented on WFLY-11411:
--------------------------------------
Yes, agreed, something had been configured incorrectly on my side. I think I was tripped up with the version numbers being in the deployment path. Please close.
> ModuleClassLoader fails with ClassNotFoundException when class in a jar file
> ----------------------------------------------------------------------------
>
> Key: WFLY-11411
> URL: https://issues.jboss.org/browse/WFLY-11411
> Project: WildFly
> Issue Type: Bug
> Components: Class Loading
> Affects Versions: 11.0.0.Final, 14.0.0.Final
> Environment: Wildfly 11, 14, Java 1.8, Windows 10
> Reporter: Karl Nicholas
> Assignee: Yeray Borges
> Priority: Major
> Attachments: JaxRsActivator.java, RestSever.java
>
>
> Simple REST service with Application activator in project and Rest Server in another project with jar file fails to load.
> Works okay with EAR project structure but not with simpler WAR project structure.
> Caused by: java.lang.ClassNotFoundException: rest.service.server.RestSever from [Module "deployment.restserver7.war" from Service Module Loader]
> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
> at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 7 months