yawlfoundation / yawl

Yet Another Workflow Language
http://www.yawlfoundation.org
GNU Lesser General Public License v3.0
88 stars 35 forks source link

The package org.w3c.dom.ls is accessible from more than one module: <unnamed>, java.xml #635

Closed micherlinman closed 3 years ago

micherlinman commented 4 years ago

In my clone I get following error ( in src\org\yawlfoundation\yawl\scheduling\util\XMLUtils.java) : The package org.w3c.dom.ls is accessible from more than one module: , java.xml in line 31

import org.w3c.dom.ls.LSInput;
import org.w3c.dom.ls.LSResourceResolver;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

and same error for "import javax.xml.XMLConstants;"

I am using Java jdk 14.2 and Eclipse 2020-06. Anyone knows how to fix that?

adamsmj commented 3 years ago

The erros indicate that you have 2 copies of 'xmlparserv2.jar' (or similar) on your eclipse classpath (i.e. one other besides the one in the yawl 'build/3rdparty' subfolder). Find and remove one or the other. Note: this jar is used only by the scheduling service.

Please confirm that this fixes the problem.

micherlinman commented 3 years ago

So, I removed the xmlparserv2 libary from project. But there is one more problem in https://github.com/yawlfoundation/yawl/blob/master/src/org/yawlfoundation/yawl/scheduling/util/XMLUtils.java . The import javax.xml.transform.stream.StreamSource; has still an error "package javax.xml.transform.stream is accessible from more than one module: , java.xml". I tried to run the project on a newly installed windows and on a newly installed ubuntu vm. On both systems I get the same problem too. I just clone the project and try to run the control panel. Do I need to run a build command manually or something like that?

adamsmj commented 3 years ago

Yes, everything is built through Ant scripts. See build/build.xml for details

micherlinman commented 3 years ago

Now I set the databse to mysql and I get an

by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider] as strategy [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]

I updated the c3p0 jar to 0.9.5.5 but its still broke

D:\yawl\output>java -jar YAWL_Standalone_4.3.1.jar
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
Exception in thread "main" org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:261)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:225)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260)
        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94)
        at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
        at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1887)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845)
        at org.yawlfoundation.yawl.util.HibernateEngine.initialise(HibernateEngine.java:99)
        at org.yawlfoundation.yawl.util.HibernateEngine.<init>(HibernateEngine.java:72)
        at org.yawlfoundation.yawl.util.HibernateEngine.<init>(HibernateEngine.java:77)
        at org.yawlfoundation.yawl.authentication.YSessionCache.initDb(YSessionCache.java:272)
        at org.yawlfoundation.yawl.authentication.YSessionCache.<init>(YSessionCache.java:50)
        at org.yawlfoundation.yawl.engine.YEngine.<init>(YEngine.java:117)
        at org.yawlfoundation.yawl.engine.YEngine.getInstance(YEngine.java:141)
        at org.yawlfoundation.yawl.engine.YEngine.getInstance(YEngine.java:155)
        at org.yawlfoundation.yawl.engine.YEngine.getInstance(YEngine.java:149)
        at org.yawlfoundation.yawl.engine.gui.YAdminGUI.<init>(YAdminGUI.java:303)
        at org.yawlfoundation.yawl.engine.gui.TabbedEngineGUI.makeAdminPanel(TabbedEngineGUI.java:77)
        at org.yawlfoundation.yawl.engine.gui.TabbedEngineGUI.<init>(TabbedEngineGUI.java:60)
        at org.yawlfoundation.yawl.engine.gui.TabbedEngineGUI.createAndShowGUI(TabbedEngineGUI.java:120)
        at org.yawlfoundation.yawl.engine.gui.TabbedEngineGUI.main(TabbedEngineGUI.java:156)
Caused by: org.hibernate.HibernateException: Could not instantiate connection provider [org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider]
        at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.instantiateExplicitConnectionProvider(ConnectionProviderInitiator.java:197)
        at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.initiateService(ConnectionProviderInitiator.java:120)
        at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.initiateService(ConnectionProviderInitiator.java:55)
        at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:105)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:251)
        ... 23 more
Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider] as strategy [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]
        at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:128)
        at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.instantiateExplicitConnectionProvider(ConnectionProviderInitiator.java:194)
        ... 27 more

My build.properties :

# The installation path is only used if there is no CATALINA_HOME environment variable
# defined.
catalina.home=C\:xampp\tomcat
tomcat.treatAsDedicated=false

# Database information:
# Type must match the suffix to one of the available hibernate.properties.* files:
#    [postgres, derby, hypersonic, mysql, oracle, h2]
# Path is as follows the jdbc:<driver>: part of the URL (examples in properties files)
# User and password as required (for example, not needed for Derby or H2)
database.type=mysql
database.path=localhost\:3306
database.user=root
database.password=mypw
adamsmj commented 3 years ago

if you locate and look in 'hibernate.properties' (depending on how you've built it, the file will be in either the tomcat/yawllib dir or the tomcat/webapps//WEB-INF/classes dirs), you will see an example of the expected connection url. Make sure what you have for the 'hibernate.connection.url' key matches that pattern

micherlinman commented 3 years ago

In my Spring Boot Java applicantions I use "spring.datasource.url = jdbc:mysql:///tableName" to connect to database and it works. For yawl I cloned the project, added my mysql data to build.properties and ran "ant buildAll". After that I started my local xampp mysql server and ran "java -jar YAWL_Standalone_4.3.1.jar" and I get this problem. In the standalone.jar the hibernate.properties file looks like

## MySQL

hibernate.dialect org.hibernate.dialect.MySQL57Dialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql:///yawl
hibernate.connection.username root
hibernate.connection.password mypw

# URL example:
# jdbc:mysql:///yawl

It matches the pattern and my connection string in other projects. But the file is in the root of the jar and not in tomcat/... . So is my build method wrong?