I have a bpm-platform.xml, the content of which is :
<?xml version="1.0" encoding="UTF-8"?>
<bpm-platform xmlns="http://www.camunda.org/schema/1.0/BpmPlatform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.camunda.org/schema/1.0/BpmPlatform http://www.camunda.org/schema/1.0/BpmPlatform">
<job-executor>
<job-acquisition name="default" />
</job-executor>
<process-engine name="default">
<job-acquisition>default</job-acquisition>
<configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration</configuration>
<datasource>java:jdbc/ProcessEngine</datasource>
<properties>
<property name="history">full</property>
<property name="databaseSchemaUpdate">true</property>
<property name="authorizationEnabled">true</property>
</properties>
</process-engine>
</bpm-platform>
Once this xml is published in my server, I get this error :
SAXParseException: cvc-elt.1: Cannot find the declaration of element 'bpm-platform'.
Can someone please point me in the right direction as to what mistake I am making ?
Related
good evening.
I'm trying to create a project that uses:
Java
JSF 2.3
Maven
CDI 2.0
Hibernate
Wildfly server
My intention here is to learn the basics of all these fellas.
At first I followed an awesome [tutorial by #BalusC][1] that tought me how to set up and first run the webapp.
My problem now rests on integrating the database with the application. I followed some guides and searched a bit on internet and found that a way to do it is by editing web.xml and persistence.xml. (I tried to keep it as close to hist tutorial as possible).
Here are my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0" metadata-complete="true">
<display-name>project</display-name>
... (some params)
<data-source>
<name>java:global/projectDS</name>
<class-name>org.postgresql.ds.PGConnectionPoolDataSource</class-name>
<url>jdbc:postgresql://localhost:5432/project</url>
</data-source>
... (servlet info)
</web-app>
And my persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
<persistence-unit name="projectPU"
transaction-type="JTA">
<jta-data-source>java:global/projectDS</jta-data-source>
<class>project.entity.Message</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.PostgreSQL95Dialect" />
<property name="hibernate.default_schema" value="main" />
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="javax.persistence.jdbc.driver"
value="org.postgresql.Driver" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
When I run the web app I receive the following error:
Caused by: org.jboss.as.controller.OperationFailedException: WFLYJCA0117: org.postgresql.ds.PGConnectionPoolDataSource is not a valid javax.sql.DataSource implementation [ "WFLYJCA0117: org.postgresql.ds.PGConnectionPoolDataSource is not a valid javax.sql.DataSource implementation" ]
I'd like to know if any of you know what I'm doing wrong and how can I work it out.
P.S.: I read on WildFly's page that WildFly has it's own Hibernate "version", and some foruns said that there might be some issues while working with an "external" hibernate source. However, as my Hibernate configuration has nothing linked to any of Wildfly's config (i believe so), I guess that's not the problem.
Thanks in advance.
UPDATE #1
I tried solution #2 from link #TacheDeChoco sent. At first it worker, but I got another error that I'm still trying to solve. I'll try I little bit more and will come here If a more complete feedback.
Ansewring your questions: by the time I first asked, I hadn't done any of the things you asked.
TY very much.
Did you
register a new postgres module (with the appropriate jar) in Wildfly ?
Declare the datasource, along with the used driver, in wildfly config file (standalone-***.xml) ?
Nice explanations can be found here (see option#2):
https://www.stenusys.com/how_to_setup_postgresql_datasource_with_wildfly/
I am trying to create a camel route in spring boot. I get the following error.
Caused by: org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw '301 Moved Permanently'.
My applicationContext.xml looks like this.
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xmlns:cxf="http://cxf.apache.org/blueprint/core"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xmlns:camelcxf="http://camel.apache.org/schema/blueprint/cxf"
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd
http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd"
default-activation="lazy">
<!-- CXF SERVER -->
<camelcxf:rsServer id="productRestController"
address="http://0.0.0.0:8080/product"
serviceClass="com.born.oktopus.product.controller.ProductRestController"
loggingFeatureEnabled="true" loggingSizeLimit="20" >
<!-- <cxf:schemaLocations> <value>classpath:/schemas/productDataList.xsd</value>
</cxf:schemaLocations> <camelcxf:providers> <ref component-id="jaxbProviderXsi"
/> </camelcxf:providers> -->
</camelcxf:rsServer>
<!-- ERP BEANS -->
<bean id="loggingOutInterceptor"
class="org.apache.cxf.interceptor.LoggingOutInterceptor" >
<property name="prettyLogging" value="true" />
</bean>
</blueprint>
It sounds like you are trying to validate a transformation file with an XML file instead of an XSD as the applicationContext.xml appears correct.
You need to show us the JAVA code where you are parsing with SAX, but I would guess you either have a typo of some kind or you are thinking you are parsing the XSD file, but you reference the XML file.
I'm using JPA with hibernate under my small resteasy project deployed on wildfly.
I've got my persistence.xml file under directory:
resources/META-INF/
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="PostgresDS" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>java:jboss/datasources/PostgresDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>
</persistence-unit>
</persistence>
So I'm dropping and creating database each time on startup.
When typing annotation #Column(name="SomeName") I've got error that
"Cannot resolve column "Name" "
and as fix I'm supposed to attach data-source.
Should I prepare some hibernate config file(attaching data-source didn't help), maybe disabling some validation ?
I am using JBoss Developer Studio. I have a project with a persistence.xml file. The file is perfect to me, but I keep getting this error on the tab that lists all the Problems of my project.
Class "[Ljava.lang.String;#22ec7158" cannot be resolved
I include the picture for a better context.
When I click on the error, so that it takes me to the place where the error is happening, it takes me to the end of the file.
Persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="Persistence">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/MemberOfferDS</jta-data-source>
<class>com.bbb.memberoffer.model.SycsCoordinator</class>
<class>com.bbb.aicweb.memberoffer.model.SycsCoordinatorPhoneNumber</class>
<class>com.bbb.memberoffer.model.SycsCoordinatorClub</class>
<class>com.bbb.memberoffer.model.SycsCoordinatorSecurityGroup</class>
<class>com.bbb.memberoffer.model.SycsCoordinatorClubPk</class>
<class>com.bbb.memberoffer.model.PhoneNumberType</class>
<class>com.bbb.memberoffer.model.Club</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<!-- Not sure if this is the right one to use or not? -->
<property name='hibernate.show_sql' value='true' />
<property name='hibernate.format_sql' value='true' />
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
</properties>
</persistence-unit>
</persistence>
You may have solved this already, however, in my case the problem was caused by referencing a class in a element that no longer existed.
EDIT: The exact reason for this type of error message is that the error generator is trying to run a toString() on a String array when it generates the error message.
I am using PMD plugin (version 4.0.2) for Eclipse (Eclipse Kepler Java EE). I have configured a naming rule: ShortVariable.
This works fine except for parameters like "id" and "e". I want PMD to ignore these. So I searched for a way to ignore certain parameters. I found this link (although it's for phpmd) and tried it, yet I can't seem to get it working. My config file looks like this (XML):
<?xml version="1.0"?>
<ruleset name="My PMD ruleset"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>
My PMD
</description>
<rule ref="rulesets/java/naming.xml/ShortVariable">
<property name="exceptions" value="id" />
</rule>
</ruleset>
When I try to import this ruleset using the eclipse plugin, it shows no possible rules to import.
Any ideas?
I found a solution to my problem here.
The resulting xml looks like this:
<?xml version="1.0"?>
<ruleset name="My PMD ruleset"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>
My PMD
</description>
<rule ref="rulesets/java/naming.xml/ShortVariable">
<properties>
<property name="xpath">
<value>
//VariableDeclaratorId[(string-length(#Image) < 3) and (not (#Image='id'))]
[not(ancestor::ForInit)]
[not((ancestor::FormalParameter) and (ancestor::TryStatement))]
</value>
</property>
</properties>
</rule>
</ruleset>
To be able to ignore more variable names, repeat the following part:
and (not (#Image='myVariableToIgnore'))
The folowing XML is valid for PHP tool PHPMD 2.2.3
<?xml version="1.0"?>
<!DOCTYPE ruleset>
<ruleset
name="My PMD ruleset for symfony 2.5"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"
>
<rule ref="rulesets/unusedcode.xml" />
<rule ref="rulesets/codesize.xml" />
<rule ref="rulesets/cleancode.xml" />
<rule ref="rulesets/controversial.xml" />
<rule ref="rulesets/design.xml" />
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable" />
</rule>
<rule ref="rulesets/naming.xml/ShortVariable">
<properties>
<property name="exceptions" value="id,em" />
</properties>
</rule>
</ruleset>
Update xml
<rule ref="category/java/codestyle.xml/ShortVariable">
<properties>
<property name="xpath">
<value>
//VariableDeclaratorId[(string-length(#Image) < 3) and (not (#Name='id'))]
[not(ancestor::ForInit)]
[not((ancestor::FormalParameter) and (ancestor::TryStatement))]
</value>
</property>
</properties>
</rule>