Fuse ESB JPA Entity not persisting - jpa

I have been attempting to us JPA to persist an entity in a simple Fuse ESB project, but I'm facing the problem that the entity never gets written to the the underlying database. The project is structured with the following three modules:
simple-datasource
simple-model
simple-service
The datasource is configured through blueprint and the datasource attached to jndi:
<?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"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<bean id="simpleDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:#(DESCRIPTION=(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVICE_NAME=xyz))(ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.xx.xx)(PORT=1521)))" />
<property name="username" value="username" />
<property name="password" value="password" />
</bean>
<service ref="simpleDataSource" interface="javax.sql.DataSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/simpleDataSource" />
</service-properties>
</service>
The model defines a persistent unit inside persistence.xml file and references the datasource through jndi:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="2.0">
<persistence-unit name="simple-service-persistence-unit" transaction-type="JTA">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<jta-data-source>osgi.jndi.service.name=jdbc/simpleDataSource</jta-data-source>
<!-- list of the persistance classes -->
<class>com.model.SimpleRow</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
</persistence-unit>
The SimpleRow class uses JPA annotations:
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
#Entity
#Table(name = "SIMPLE")
public class SimpleRow {
#Column(name = "simple_id")
private Long simpleId;
#Column(name = "simple_text", length =100)
private String simpleText;
public Long getSimpleId() {
return simpleId;
}
public void setSimpleId(Long simpleId) {
this.simpleId = simpleId;
}
public String getSimpleText() {
return simpleText;
}
public void setSimpleText(String simpleText) {
this.simpleText = simpleText;
}
}
I then inject the EntityManager into a service, again using blueprint and a reference to the simple-service-persistence-unit and specify that method level transaction demarcation should be used (as I've seen in all the examples):
<?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:jpa="http://aries.apache.org/xmlns/jpa/v1.1.0" xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.1.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://aries.apache.org/xmlns/jpa/v1.1.0 http://aries.apache.org/schemas/jpa/jpa_110.xsd">
<bean id="simpleService" class="com.service.SimpleServiceImpl">
<jpa:context property="entityManager" unitname="simple-service-persistence-unit" />
<tx:transaction method="*" value="Required" />
</bean>
<service ref="simpleService" interface="com.service.SimpleService" />
The simple service simply creates an entity and persists it using the EntityManager as follows:
public class SimpleServiceImpl implements SimpleService {
EntityManager entityManager;
public void invokeSimpleService() {
try {
SimpleRow row = new SimpleRow();
row.setSimpleText("Some simple text");
entityManager.persist(row);
System.out.println("Persisted row...");
} catch (Exception e) {
System.out.println("An error occurred: " + e.getMessage());
}
} ...
One final configuration which is relevant is the feature set which is as follows:
<feature dependency="true" version="${activemq.version}">activemq-camel</feature>
<feature dependency="true" version="${camel.version}">camel-blueprint</feature>
<feature dependency="true" version="${camel.version}">camel-core</feature>
<feature dependency="true" version="${cxf.version}">cxf</feature>
<feature dependency="true" version="${camel.version}">camel-cxf</feature>
<feature dependency="true" version="${camel.version}">camel-jpa</feature>
<feature dependency="true" version="1.0.1.fuse-71-047">transaction</feature>
<feature dependency="true" version="${jpa.version}">jpa</feature>
<feature dependency="true" version="${jndi.version}">jndi</feature>
<bundle>wrap:mvn:net.sourceforge.serp/serp/1.13.1</bundle>
<bundle>wrap:mvn:oracle/ojdbc/11.2.0.3</bundle>
<bundle>mvn:com.h2database/h2/1.3.167</bundle>
<bundle>mvn:commons-dbcp/commons-dbcp/1.4</bundle>
<bundle>mvn:org.apache.commons/commons-lang3/3.1</bundle>
<bundle>mvn:com.company/simple-datasource/${project.version}</bundle>
<bundle>mvn:com.company/simple-model/${project.version}</bundle>
<bundle>mvn:com.company/simple-service/${project.version}</bundle>
I have verified that the datasource works correctly by injecting it as service into another module which uses it with a straight JDBC connection.
However, when invoke SimpleService.invokeSimpleService, the code executes, no exceptions are thrown but the write is not persisted on the database.
If I add a flush after the persist i.e.
entityManager.persist()
then the following error is thrown:
An error occurred: Can only perform operation while a transaction is active.
If I try and start the transaction explicitly, and remove the tx:transaction annotation on the service bean config, then it fails with the following error:
An error occurred: Transaction management is not available for container managed EntityManagers.
Other information that might be of relevance. The underlying EntityManager implementation is:
org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager
Also the list of installed aries components is:
[ 7] [Active ] [Created ] [ ] [ 20] Apache Aries Blueprint Core (1.0.1.fuse-71-047)
[ 9] [Active ] [ ] [ ] [ 20] Apache Aries Util (1.0.0)
[ 10] [Active ] [Created ] [ ] [ 20] Apache Aries Blueprint CM (1.0.1.fuse-71-047)
[ 11] [Active ] [ ] [ ] [ 20] Apache Aries Proxy API (1.0.0)
[ 12] [Active ] [ ] [ ] [ 20] Apache Aries Proxy Service (1.0.0)
[ 13] [Active ] [ ] [ ] [ 20] Apache Aries Blueprint API (1.0.1.fuse-71-047)
[ 25] [Active ] [ ] [ ] [ 30] Apache Aries JMX Blueprint API (1.0.1.fuse-71-047)
[ 30] [Active ] [ ] [ ] [ 30] Apache Aries JMX Blueprint Core (1.0.1.fuse-71-047)
[ 33] [Active ] [ ] [ ] [ 30] Apache Aries JMX API (1.0.1.fuse-71-047)
[ 38] [Active ] [ ] [ ] [ 30] Apache Aries JMX Core (1.0.1.fuse-71-047)
[ 75] [Active ] [ ] [ ] [ 60] Aries JPA Container Managed Contexts (1.0.0)
[ 77] [Active ] [Created ] [ ] [ 60] Apache Aries Transaction Enlisting JDBC Datasource (1.0.1.fuse-71-047)
[ 81] [Active ] [ ] [ ] [ 60] Aries JPA Container API (1.0.0)
[ 100] [Active ] [Created ] [ ] [ 60] Apache Aries Transaction Blueprint (1.0.1.fuse-71-047)
[ 118] [Active ] [ ] [ ] [ 60] Apache Aries JNDI API (1.0.0)
[ 125] [Active ] [ ] [ ] [ 60] Aries JPA Container (1.0.0)
[ 139] [Active ] [ ] [ ] [ 60] Apache Aries JNDI Core (1.0.0)
[ 144] [Active ] [ ] [ ] [ 60] Apache Aries JNDI Support for Legacy Runtimes (1.0.0)
[ 146] [Active ] [ ] [ ] [ 60] Apache Aries JNDI RMI Handler (1.0.0)
[ 168] [Active ] [Created ] [ ] [ 60] Aries JPA Container blueprint integration for Aries blueprint (1.0.0)
[ 176] [Active ] [ ] [ ] [ 60] Apache Aries Transaction Manager (1.0.1.fuse-71-047)
[ 177] [Active ] [ ] [ ] [ 60] Apache Aries JNDI URL Handler (1.0.0)
Is there anything obviously wrong with this configuration, which follows most of the examples online?

I'm not sure exactly when using resource_local as the transaction type is appropriate in the persistence layer. However, modifying persistence.xml to use JTA and jta-data-source as follows fixed my issue:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="2.0">
<persistence-unit name="simple-service-persistence-unit"
transaction-type="JTA">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
<!--non-jta-data-source>osgi:service/jdbc/simpleDataSource</non-jta-data-source-->
<jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/simpleDataSource)</jta-data-source>
<class>com.company.model.SimpleRow</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="openjpa.Log" value="DefaultLevel=INFO, Tool=INFO, SQL=TRACE"/>
</properties>
</persistence-unit>

Related

Send mail using SQL Server

I am trying to send an email from a Trigger, on SQL Server 2008 . The data of the email will be, just a plain hardcoded text.
When user clicks on a trigger button from application my sp needs to send mail to specified users.
(Do i need to specify the users somewhere?)
Can someone provide some sample code on how to do this, please?
I've not set up any SQL mail and stuff, so I'm guessing it's built in.
like you set first you need to configure you SQL instance
Permissions
You must be a member of the sysadmin fixed server role to
use the Send Test E-Mail dialog box. Users who are not members of the
sysadmin fixed server role can test Database Mail using the
sp_send_dbmail procedure.
Procedure Using Object Explorer in SQL Server Management Studio,
connect to an instance of SQL Server Database Engine where Database
Mail is configured, expand Management, right-click Database Mail, and
then select Send Test E-Mail. If no Database Mail profiles exist, a
dialog prompts the user to create a profile and opens the Database
Mail Configuration Wizard.
In the Send Test E-Mail from dialog box, in the Database Mail Profile
box select the profile you want to test.
In the To box, type the e-mail name of the recipient of the test
e-mail.
In the Subject box, type the subject line for the test e-mail. Change
the default subject to better identify your e-mail for
troubleshooting.
In the Body box, type to body of the test e-mail. Change the default
subject to better identify your e-mail for troubleshooting.
Select Send Test E-Mail to send the test e-mail to the Database Mail
queue.
Sending the test e-mail opens the Database Mail Test E-Mail dialog
box. Make a note of the number displayed in the Sent e-mail box. This
is the mailitem_id of the test message. Select OK.
On the Toolbar select New Query to open a Query Editor window. Run the
following T-SQL statement to determine the status of the test e-mail
message:
SQL
Copy SELECT * FROM msdb.dbo.sysmail_allitems WHERE mailitem_id = ;
click here to see the documentation
here is the sintaxis to use it.
Syntax
Copy
sp_send_dbmail [ [ #profile_name = ] 'profile_name' ]
[ , [ #recipients = ] 'recipients [ ; ...n ]' ]
[ , [ #copy_recipients = ] 'copy_recipient [ ; ...n ]' ]
[ , [ #blind_copy_recipients = ] 'blind_copy_recipient [ ; ...n ]' ]
[ , [ #from_address = ] 'from_address' ]
[ , [ #reply_to = ] 'reply_to' ]
[ , [ #subject = ] 'subject' ]
[ , [ #body = ] 'body' ]
[ , [ #body_format = ] 'body_format' ]
[ , [ #importance = ] 'importance' ]
[ , [ #sensitivity = ] 'sensitivity' ]
[ , [ #file_attachments = ] 'attachment [ ; ...n ]' ]
[ , [ #query = ] 'query' ]
[ , [ #execute_query_database = ] 'execute_query_database' ]
[ , [ #attach_query_result_as_file = ] attach_query_result_as_file ]
[ , [ #query_attachment_filename = ] query_attachment_filename ]
[ , [ #query_result_header = ] query_result_header ]
[ , [ #query_result_width = ] query_result_width ]
[ , [ #query_result_separator = ] 'query_result_separator' ]
[ , [ #exclude_query_output = ] exclude_query_output ]
[ , [ #append_query_error = ] append_query_error ]
[ , [ #query_no_truncate = ] query_no_truncate ]
[ , [ #query_result_no_padding = ] #query_result_no_padding ]
[ , [ #mailitem_id = ] mailitem_id ] [ OUTPUT ]
click here to se the documetnation how to use.

How to parse date pattern using grok

How to parse the below log line using grok
Also how to match the pattern of the date.
I tried %{TIMESTAMP_ISO8601:logtime} but no match
Log Line:
13-Nov-2019 00:00:20.230 DEBUG [[ACTIVE] ExecuteThread: '272' for queue: 'weblogic.kernel.Default (self-tuning)'] [196.157.7.12] 965929132 [wire] >> "[\n]"
The question is a bit unclear as to exactly what fields you want them mapped to.
So, here's what matches for me:
%{MONTHDAY:day}[-]%{MONTH:month}[-]%{YEAR:year} %{TIME:time} %{WORD:logtype} \[\[%{WORD:status}\] ExecuteThread: '%{NUMBER:threadNumber}' for queue: '%{GREEDYDATA:queueData}'\] \[%{IP:ip}\] %{NUMBER:numbers} \[%{WORD:text}\] >> "\[\\n\]"
The first 4 fields, answer your date/time pattern query and the rest is what I have used to fit the rest of the fields. Since, no exact mappings were provided , I have mapped them as per my understanding using
This is the output:
{
"day": [
[
"13"
]
],
"month": [
[
"Nov"
]
],
"year": [
[
"2019"
]
],
"time": [
[
"00:00:20.230"
]
],
"logtype": [
[
"DEBUG"
]
],
"status": [
[
"ACTIVE"
]
],
"threadNumber": [
[
"272"
]
],
"queueData": [
[
"weblogic.kernel.Default (self-tuning)"
]
],
"ip": [
[
"196.157.7.12"
]
],
"numbers": [
[
"965929132"
]
],
"text": [
[
"wire"
]
]
}
You can break 'time' further if you want. For any other combinations of patterns, refer Grok Patterns.

Aries JPA EntityManager services not starting for WebLogic data source

I'm trying to get an OSGi persistence bundle working on WebLogic's built-in Felix framework. As per the WebLogic OSGi documentation, my WebLogic data source test-ds appears to be available as a service within OSGi:
Service 59 - [weblogic.jdbc.common.internal.RemoteDataSource, javax.sql.DataSource, javax.sql.CommonDataSource, java.sql.Wrapper, weblogic.jdbc.extensions.WLDataSource, java.rmi.Remote, weblogic.jdbc.common.internal.DataSourceMetaData, weblogic.common.resourcepool.ObjectLifeCycle, weblogic.jndi.CrossPartitionAware] (pid: n/a)
from Bundle 0 - System Bundle (org.apache.felix.framework), version 5.6.0
Name: test-ds
service.bundleid: 0
service.scope: singleton
I've created a persistence bundle com.test.persistence-bundle with the following entity class:
#Entity
public class TestEntity {
#Id
private Integer id;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
... and persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.2" xmlns="http://java.sun.com/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">
<persistence-unit name="test-pu" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>osgi:service/test-ds</jta-data-source>
<non-jta-data-source>osgi:service/test-ds</non-jta-data-source>
<class>test.model.TestEntity</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle12cDialect"/>
</properties>
</persistence-unit>
</persistence>
... and manifest:
Manifest-Version: 1.0
Bnd-LastModified: 1556912147017
Build-Jdk: 1.8.0_171
Built-By: roadkill
Bundle-ManifestVersion: 2
Bundle-Name: test-persistence-bundle
Bundle-SymbolicName: com.test.persistence-bundle
Bundle-Version: 1.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
DynamicImport-Package: org.hibernate.proxy,javassist.util.proxy
Export-Package: test.model;uses:="javax.persistence";version="1.0.0"
Import-Package: javax.persistence;version="[2.2,3)",org.hibernate.proxy;
resolution:=optional,javassist.util.proxy;resolution:=optional
Meta-Persistence: META-INF/persistence.xml
Provide-Capability: osgi.service;effective:=active;objectClass="javax.pe
rsistence.EntityManager";osgi.unit.name=test-pu,osgi.service;effective:
=active;objectClass="javax.persistence.EntityManagerFactory";osgi.unit.
name=test-pu,osgi.service;effective:=active;objectClass="org.apache.ari
es.jpa.template.JpaTemplate";osgi.unit.name=test-pu,osgi.service;effect
ive:=active;objectClass="org.apache.aries.jpa.supplier.EmSupplier";osgi
.unit.name=test-pu
Require-Capability: osgi.extender;osgi.extender="aries.jpa",osgi.service
;effective:=active;objectClass="javax.persistence.spi.PersistenceProvid
er";javax.persistence.provider="org.hibernate.jpa.HibernatePersistenceP
rovider",osgi.service;effective:=active;objectClass="javax.transaction.
TransactionManager",osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Tool: Bnd-4.2.0.201903051501
I've also created a client bundle com.test.service-impl which implements TestService from another bundle:
#Component(service = TestService.class)
public class TestServiceImpl implements TestService {
#PersistenceContext(unitName = "test-pu")
EntityManager em;
#Override
public void foo() {
System.out.println(em);
}
}
The EntityManager instance should be injected via the blueprint for the service implementation:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:jpa="http://aries.apache.org/xmlns/jpa/v2.0.0" xmlns:tx="http://aries.apache.org/xmlns/transactions/v2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<jpa:enable />
<tx:enable />
<bean id="testService" class="test.service.impl.TestServiceImpl"/>
<service ref="testService" interface="test.service.TestService"/>
</blueprint>
However, em is always null. It seems the EntityManager services are never started even though all bundles are Active. I get the following message when updating com.test.service-impl:
13:20:36.380 [Blueprint Extender: 1] INFO org.apache.aries.blueprint.container.BlueprintContainerImpl - Blueprint bundle com.test.service-impl/1.0.0.SNAPSHOT is waiting for dependencies [(&(osgi.unit.name=test-pu)(objectClass=javax.persistence.EntityManager))]
13:20:36.380 [Blueprint Extender: 1] DEBUG org.apache.aries.blueprint.container.BlueprintEventDispatcher - Sending blueprint container event BlueprintEvent[type=GRACE_PERIOD, dependencies=[(&(osgi.unit.name=test-pu)(objectClass=javax.persistence.EntityManager))]] for bundle com.test.service-impl/1.0.0.SNAPSHOT
I'm using Aries JPA to wire everything together with Hibernate as the persistence provider. I also have Aries Blueprint and Aries Transaction installed along with all required dependencies.
Here are the relevant bundles from my bundlelist:
com.test.persistence-api (1.0.0.SNAPSHOT) "test-persistence-api" [active, 23]
com.test.persistence-bundle (1.0.0.SNAPSHOT) "test-persistence-bundle" [active, 25]
com.test.service-impl (1.0.0.SNAPSHOT) "test-service-impl" [active, 21]
javax.persistence-api (2.2) "Java(TM) Persistence API jar" [active, 45]
javax.transaction-api (1.2) "javax.transaction API" [active, 10]
javax.transaction-api (1.3) "javax.transaction API" [active, 18]
org.apache.aries.blueprint.annotation.impl (1.0.1) "Apache Aries Blueprint Annotation Impl" [active, 32]
org.apache.aries.blueprint.core (1.10.2) "Apache Aries Blueprint Core" [active, 19]
org.apache.aries.jpa.api (2.7.2) "Apache Aries JPA Container API" [active, 44]
org.apache.aries.jpa.blueprint (2.7.2) "Apache Aries JPA blueprint" [active, 22]
org.apache.aries.jpa.container (2.7.2) "Apache Aries JPA container" [active, 64]
org.apache.aries.jpa.javax.persistence_2.1 (2.7.2) "Apache Aries JPA Specification 2.1 API" [active, 67]
org.apache.aries.jpa.support (2.7.2) "Apache Aries JPA support" [active, 66]
org.apache.aries.proxy (1.1.4) "Apache Aries Proxy Service" [active, 70]
org.apache.aries.transaction.blueprint (2.2.0) "Apache Aries Transaction Blueprint" [active, 52]
org.apache.aries.transaction.manager (1.3.3) "Apache Aries Transaction Manager" [active, 34]
org.apache.aries.util (1.1.3) "Apache Aries Util" [active, 30]
org.hibernate.common.hibernate-commons-annotations (5.1.0.Final) "hibernate-commons-annotations" [active, 56]
org.hibernate.orm.core (5.3.10.Final) "hibernate-core" [active, 31]
org.hibernate.orm.core (5.4.2.Final) "hibernate-core" [active, 29]
org.hibernate.orm.osgi (5.4.2.Final) "hibernate-osgi" [active, 59]
org.osgi.service.blueprint (1.0.2.201505202024) "org.osgi:org.osgi.service.blueprint" [active, 27]
org.osgi.service.cm (1.5.0.201505202024) "org.osgi:org.osgi.service.cm" [active, 6]
org.osgi.service.coordinator (1.0.2.201505202024) "org.osgi:org.osgi.service.coordinator" [active, 73]
org.osgi.service.jdbc (1.0.0.201505202023) "org.osgi:org.osgi.service.jdbc" [active, 37]
org.osgi.util.function (1.1.0.201802012106) "org.osgi:org.osgi.util.function" [active, 65]
org.osgi.util.promise (1.1.1.201810101357) "org.osgi:org.osgi.util.promise" [active, 17]
Any ideas?
Thanks in advance!
TL;DR: It turns out this was due to a bug in the version of Felix that WebLogic ships with. I was able to upgrade the framework by simply replacing \wlserver\server\lib\org.apache.felix.org.apache.felix.main.jar and \wlserver\server\lib\osgi.jar with the latest versions of felix-main and osgi-core, respectively.
While trying to figure out the source of the issue, I ended up downloading and manually reading through Karaf's jpa, transaction, and hibernate features to ensure all of the proper bundles were installed and started in the correct order. WebLogic allows you to specify start levels by placing bundles inside of subdirectories within the osgi-lib folder. I'm not sure how helpful this was in the long run, but it gave me some confidence that things were set up in a verified way.
Here's the list of bundles, with versions and start levels, that I gathered from the Karaf features (not shown: logging/console/shell stuff):
START LEVEL 100
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (6.0.3)
[ 1] [Active ] [ 10] Apache Felix Configuration Admin Service (1.9.14)
[ 2] [Active ] [ 11] Apache Felix File Install (3.6.4)
[ 3] [Active ] [ 20] org.objectweb.asm (7.1.0)
[ 4] [Active ] [ 20] org.objectweb.asm.tree.analysis (7.1.0)
[ 5] [Active ] [ 20] org.objectweb.asm.commons (7.1.0)
[ 6] [Active ] [ 20] org.objectweb.asm.tree (7.1.0)
[ 7] [Active ] [ 20] org.objectweb.asm.util (7.1.0)
[ 8] [Active ] [ 20] Apache Aries Blueprint API (1.0.1)
[ 9] [Active ] [ 20] Apache Aries Blueprint CM (1.3.1)
[ 10] [Active ] [ 20] Apache Aries Blueprint Core (1.10.2)
[ 11] [Resolved ] [ 20] Apache Aries Blueprint Core Compatiblity Fragment Bundle (1.0.0)
[ 12] [Active ] [ 20] Apache Aries Proxy Service (1.1.4)
[ 13] [Active ] [ 20] Apache Aries Util (1.1.3)
[ 14] [Active ] [ 30] jaxb-api (2.3.1)
[ 15] [Active ] [ 30] Apache Aries JMX API (1.1.5)
[ 16] [Active ] [ 30] Apache Aries JMX Blueprint API (1.2.0)
[ 17] [Active ] [ 30] Apache Aries JMX Blueprint Core (1.2.0)
[ 18] [Active ] [ 30] Apache Aries JMX Core (1.1.8)
[ 19] [Active ] [ 30] Apache Aries Whiteboard support for JMX DynamicMBean services (1.2.0)
[ 20] [Active ] [ 30] Apache Aries JPA Container API (2.7.2)
[ 21] [Active ] [ 30] Apache Aries JPA blueprint (2.7.2)
[ 22] [Active ] [ 30] Apache Aries JPA container (2.7.2)
[ 23] [Active ] [ 30] Apache Aries JPA support (2.7.2)
[ 24] [Active ] [ 30] Apache ServiceMix :: Specs :: Activation API 1.4 (2.9.0)
[ 25] [Active ] [ 5] Apache Felix EventAdmin (1.5.0)
[ 26] [Active ] [ 5] Apache Felix Metatype Service (1.2.2)
[ 27] [Active ] [ 8] jansi (1.17.1)
[ 31] [Active ] [ 80] Byte Buddy (without dependencies) (1.9.10)
[ 32] [Active ] [ 80] CDI APIs (1.2.0)
[ 33] [Active ] [ 80] ClassMate (1.3.4)
[ 34] [Active ] [ 80] org_dom4j_dom4j_2.1.1_dom4j-2.1.1.jar (0)
[ 36] [Active ] [ 80] geronimo-jta_1.1_spec (1.1.1)
[ 37] [Active ] [ 80] hibernate-commons-annotations (5.1.0.Final)
[ 38] [Active ] [ 80] hibernate-core (5.4.2.Final)
[ 39] [Active ] [ 80] hibernate-osgi (5.4.2.Final)
[ 40] [Active ] [ 80] Java Annotation Indexer (2.0.5.Final)
[ 41] [Active ] [ 80] Javassist (3.24.0.GA)
[ 42] [Active ] [ 80] Expression Language 3.0 API (3.0.0)
[ 43] [Active ] [ 80] javax.interceptor API (1.2)
[ 44] [Active ] [ 80] Java(TM) Persistence API jar (2.2)
[ 45] [Active ] [ 80] Apache Aries JPA Specification 2.1 API (2.7.2)
[ 46] [Active ] [ 80] javax.transaction API (1.2)
[ 47] [Active ] [ 80] JBoss Logging 3 (3.3.2.Final)
[ 48] [Active ] [ 80] Java Transaction API (1.1.1.Final)
[ 49] [Active ] [ 80] Apache Aries Transaction Blueprint (1.1.1)
[ 50] [Active ] [ 80] Apache Aries Transaction Blueprint (2.2.0)
[ 51] [Active ] [ 80] Apache ServiceMix :: Bundles :: javax.inject (1.0.0.2)
[ 52] [Active ] [ 80] org.osgi:org.osgi.service.jdbc (1.0.0.201505202023)
[ 53] [Active ] [ 80] pax-transx-tm-api (0.4.3)
[ 54] [Active ] [ 80] pax-transx-tm-geronimo (0.4.3)
[ 55] [Active ] [ 9] Apache Felix Coordinator Service (1.0.2)
[ 61] [Active ] [ 1] Apache Felix Declarative Services (2.1.16)
[ 65] [Active ] [ 1] org.osgi:org.osgi.util.function (1.1.0.201802012106)
[ 66] [Active ] [ 1] org.osgi:org.osgi.util.promise (1.1.1.201810101357)
I also made some changes to the OSGi framework configuration itself via the WebLogic console:
Boot delegation - these were mostly copied from the Karaf configuration, although sun.* and com.sun.* are definitely needed to avoid ClassNotFoundExceptions from bytebuddy:
com.sun.*, javax.transaction, javax.transaction.*, javax.xml.crypto, javax.xml.crypto.*, jdk.nashorn.*, sun.*, jdk.internal.reflect, jdk.internal.reflect.*
Init Properties - again, mostly copied from Karaf:
felix.startlevel.bundle=80
org.apache.aries.blueprint.synchronous=true
org.apache.aries.proxy.weaving.disabled=org.objectweb.asm.*,org.slf4j.*,org.apache.log4j.*,javax.*,org.apache.xerces.*
org.apache.aries.proxy.weaving.enabled=none
org.osgi.framework.startlevel.beginning=100
Lastly, it appears WebLogic sets the name property of the published DataSource service to the JNDI name of the data source itself. Thus, the full value for jta-data-source should be something like:
osgi:service/javax.sql.DataSource/(name=test-ds)
Hope this helps.

How to setup distributed orientDB (Enterprise edition 2.2.9) in Sharding mode

I am using Oriednt DB enterprose 2.2.9 edition for my project. I have set the 2 server cluster for now and implemented the sharding in distributed environment. But when i am pulling data from RDBMS using teleporter, data is not distributing. Its simply replicating the data in two servers. So can you please help me in setup a distributed environment
My Config files are as follows:-
default-distributed-db-config.json:-
{
"replication": true,
"clusters": {
"internal": {
"replication": false
},
"index": {
"replication": false
},
"ODistributedConflict": {
"replication": false
},
"*": {
"replication": true,
"writeQuorum": 2,
"partitioning": {
"strategy": "round-robin",
"default": 0,
"partitions": [
[ "manoj" ],
[ "vishnu" ]
]
}
}
}
}
hazelcast.xml
orientdb
orientdb
false
false
false
5
1
1
1
1
</properties>
<network>
<port auto-increment="true">2434</port>
<join>
<multicast enabled="false">
<multicast-group>235.1.1.1</multicast-group>
<multicast-port>2434</multicast-port>
</multicast>
<tcp-ip enabled="true">
<member>10.22.20.101:2434</member>
<member>10.22.20.122:2434</member>
</tcp-ip>
</join>
</network>
<executor-service>
<pool-size>16</pool-size>
</executor-service>
Can you try delete distributed-config.json so OrientDB will read from default-distributed-db-config.json ?
Your configuration is invalid (that's an old, outdated version). Some of the 2.2 docs still reflected it, and I removed the references.
Better information is here and what Oleksandr sent you:
http://orientdb.com/docs/master/Distributed-Configuration-Tuning.html
-Colin

Exterior Shell of polygon is invalid - 2dSphere Polygon

Question, trying to index and getting the following error:
"Exterior shell of polygon is invalid"
However, I've tested the JSON on http://geojsonlint.com/ and it works
Here's my JSON
{
"type": "Polygon",
"coordinates": [
[
[
116.306655,
39.984977
],
[
116.30673,
39.984977
],
[
116.306734,
39.98483
],
[
116.30667,
39.98483
],
[
116.306678,
39.984714
],
[
116.306384,
39.984705
],
[
116.30638,
39.984858
],
[
116.306193,
39.984852
],
[
116.306198,
39.984601
],
[
116.306031,
39.984597
],
[
116.306031,
39.984596
],
[
116.306031,
39.984596
],
[
116.306023,
39.984961
],
[
116.306082,
39.984964
],
[
116.306082,
39.985019
],
[
116.306655,
39.985032
],
[
116.306655,
39.984977
]
]
]
}
What version of mongodb are you running. If you are running 2.4, try upgrading to 2.6. I had the same error message with census tiger line data that I had converted to GeoJSON, and which I had also confirmed via jsonlint. I had been running the index on version 2.4. I upgraded to mongodb version 2.6, and that solved my problem. I was able to create a 2dsphere index and run geonear queries just fine after that.