Jboss and wildfly uses jpa when they see persistence.xml in INF directories 
just change the name.

24 Şubat 2015 Salı 21:09:46 UTC+2 tarihinde Gary Udstrand yazdı:
>
> I am trying to get orientdb working using the JCA resource adapter and 
> have run into a class cast issue and I am not sure how to proceed.  I am 
> using OrientDB2.0.3 and orient-rar-0.3.0.rar (I have also pulled the latest 
> source and built 0.4.0-SNAPSHOT but i get the same error).  If I add an 
> entry to my persistence.xml (below) I get the following class cast error.   
> If I remove the entry (I can get by with out JPA) I get an error about 
> missing dependencies.   I have deployed the rar as a module in jboss 7 and 
> have added the orientdb client jars to a module (module.xml below)  as 
> well, which is referenced in the manifest file of my jar.
>
> I would love to get this working, any ideas?  If not JCA what would be the 
> best way to deploy orient for use in a jboss application?   Any assistance 
> would be appreciated. 
>
> Thanks!
> -Gary
>
>
> Caused by: java.lang.ClassCastException: java.util.Properties cannot be 
> cast to com.orientechnologies.orient.object.jpa.OJPAProperties
>     at 
> com.orientechnologies.orient.object.jpa.OJPAPersistenceProvider.createContainerEntityManagerFactory(OJPAPersistenceProvider.java:76)
>     at 
> org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:197)
>     at 
> org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$500(PersistenceUnitServiceImpl.java:57)
>     at 
> org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:96)
>     ... 4 more
>
> ------------------persistence.xml-------------
>
> from my persistence.xml
>
> <persistence-unit name="OrientJpaUnit">
>    
> <provider>com.orientechnologies.orient.object.jpa.OJPAPersistenceProvider</provider>
>    <!-- JPA entities must be registered here -->
>    <!--<class>com.example.domain.MyPOJO</class>-->
>
>    <properties>
>       <property name="javax.persistence.jdbc.url" 
> value="remote:localhost/<dbname>.odb" />
>       <property name="javax.persistence.jdbc.user" value="root" />
>       <property name="javax.persistence.jdbc.password" value="<xxxxx>" />
>       <!-- Register whole package.
>                    See 
> com.orientechnologies.orient.core.entity.OEntityManager.registerEntityClasses(String)
>  for more details -->
>       <property name="com.orientdb.entityClasses" 
> value="com.homestream.orient.domains" />
>    </properties>
> </persistence-unit>
>
> -------------------from my standalone.xml-----------------
> <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
>             <resource-adapters>
>                 <resource-adapter>
>                     <archive>
>                         orient-rar-0.3.0.rar
>                     </archive>
>                     
> <transaction-support>LocalTransaction</transaction-support>
>                     <connection-definitions>
>                         <connection-definition 
> class-name="org.ops4j.orient.adapter.impl.OrientManagedConnectionFactoryImpl" 
> jndi-name="java:orient/ConnectionFactory" enabled="true" 
> use-java-context="true" pool-name="OrientConnectionFactory">
>                             <config-property name="connectionUrl">
>                                 remote:127.0.0.1/<db name> <userid> <password>
>                             </config-property>
>                             <config-property name="type">
>                                 object
>                             </config-property>
>                         </connection-definition>
>                     </connection-definitions>
>                 </resource-adapter>
>             </resource-adapters>
>
> ---------------module.xml file used to include client jars--------
> <module xmlns="urn:jboss:module:1.0" name="com.orientechnologies.orient">
>   <resources>
>     <resource-root path="orientdb-client-2.0.jar"/>
>     <resource-root path="orientdb-core-2.0.jar"/>
>     <resource-root path="orientdb-object-2.0.jar"/>
>     <resource-root path="orientdb-object-2.0.jar"/>
>     <resource-root path="orientdb-graphdb-2.0.jar"/>
>     <resource-root path="blueprints-core-2.6.0.jar"/>
>
>     <resource-root path="concurrentlinkedhashmap-lru-1.4.1.jar"/>
>     <resource-root path="jna-4.0.0.jar"/>
>     <resource-root path="jna-platform-4.0.0.jar"/>
>     <resource-root path="hppc-0.6.0.jar"/>
>     <resource-root path="commons-beanutils-core-1.8.0.jar"/>
>     <resource-root path="commons-configuration-1.6.jar"/>
>     <resource-root path="gremlin-java-2.6.0.jar"/>
>     <resource-root path="gremlin-groovy-2.6.0.jar"/>
>     <resource-root path="groovy-1.8.9.jar"/>
>     <resource-root path="pipes-2.6.0.jar"/>
>
>     <resource-root path="asm-analysis-3.2.jar"/>
>     <resource-root path="asm-commons-3.2.jar"/>
>     <resource-root path="asm-tree-3.2.jar"/>
>     <resource-root path="asm-util-3.2.jar"/>
>
>     <resource-root path="jansi-1.5.jar"/>
>     <resource-root path="jline-0.9.94.jar"/>
>
>   </resources>
>
>   <dependencies>
>      <module name="javax.api"/>
>      <module name="javax.persistence.api"/>
>       <module name="org.javassist" slot="3.16.1-GA"/>
>   </dependencies>
> </module>
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to