I'm new in Titan world. I would like to import data stored in GraphML file into a database.
I downloaded titan-1.0.0-hadoop1
I run ./titan.sh
I run ./gremlin.sh
In Gremlin console I wrote:
:remote connect tinkerpop.server ../conf/remote.yaml
Next, I wrote:
graph.io(IoCore.graphml()).readGraph("/tmp/file.graphml")
I got message:
No such property: graph for class: groovysh_evaluate
Could you help me?
IMO the most interesting logs from gremlin-server.log:
84 [main] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Configuring Gremlin Server from conf/gremlin-server/gremlin-server.yaml
158 [main] INFO org.apache.tinkerpop.gremlin.server.util.MetricManager - Configured Metrics ConsoleReporter configured with report interval=180000ms
160 [main] INFO org.apache.tinkerpop.gremlin.server.util.MetricManager - Configured Metrics CsvReporter configured with report interval=180000ms to fileName=/tmp/gremlin-server-metrics.csv
196 [main] INFO org.apache.tinkerpop.gremlin.server.util.MetricManager - Configured Metrics JmxReporter configured with domain= and agentId=
197 [main] INFO org.apache.tinkerpop.gremlin.server.util.MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
1111 [main] WARN org.apache.tinkerpop.gremlin.server.GremlinServer - Graph [graph] configured at [conf/gremlin-server/titan-berkeleyje-server.properties] could not be instantiated and will not be available in Gremlin Server. GraphFactory message: GraphFactory could not instantiate this Graph implementation [class com.thinkaurelius.titan.core.TitanFactory]
java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class com.thinkaurelius.titan.core.TitanFactory]
...
1113 [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-*
1499 [main] INFO org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines - Loaded nashorn ScriptEngine
2044 [main] INFO org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines - Loaded gremlin-groovy ScriptEngine
2488 [main] WARN org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor - Could not initialize gremlin-groovy ScriptEngine with scripts/empty-sample.groovy as script could not be evaluated - javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: graph for class: Script1
2488 [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines.
2581 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Could not instantiate configured serializer class - org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 - it will not be available. There is no graph named [graph] configured to be used in the useMapperFromGraph setting
2582 [main] INFO org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
2719 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Could not instantiate configured serializer class - org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0 - it will not be available. There is no graph named [graph] configured to be used in the useMapperFromGraph setting
2720 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - Could not instantiate configured serializer class - org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 - it will not be available. There is no graph named [graph] configured to be used in the useMapperFromGraph setting
...
You need to create a graph. the graph keyword isn't declared anywhere in your script.
This is briefly covered in the Titan Server documentation, but it is easily overlooked.
The :> is the "submit" command which sends the Gremlin on that line to the currently active remote.
In step 5, you need to submit your script command to the remote server. In the Gremlin Console, you do this by starting your command with :submit or :> for shorthand.
:> graph.io(IoCore.graphml()).readGraph("/tmp/file.graphml")
If you don't submit the script to the remote server, the Gremlin Console will attempt to process the script within the console's JVM. graph is not defined locally, and that is why you saw the error in step 6.
Update: Based on your gremlin-server.log it looks like the issue is that the user that starts Titan with ./bin/titan.sh start doesn't have the appropriate file permissions to create the directory (db/berkeley) used by the default graph configuration (titan-berkeleyje-server.properties). Try updating the file permissions on the $TITAN_HOME directory.
Related
Recently i've been experimenting with deploying Statefull applications onto Kubernetes. For my dev environment everything is on-premise, either on my local machine or on remote VMs. I deployed OpenSearch through its helm chart, got it and dashboards up and running, and everything was going well. I am now trying to setup data-prepper running as a docker container on my local machine (the kubernetes cluster is on remote VMs, not sure if this matters). I have the kube service that defines access to OpenSearch port-forwarded to my machine and am able to access it using "curl -u : https://localhost:9200 -k". Since my only interest is seeing it up and running I don't care (yet) that it is insecure. When I setup my data-prepper pipeline to hit OpenSearch in the exact same way, it is refusing the connection and I'm at a loss as to why.
pipelines.yaml:
simple-sample-pipeline:
workers: 2
delay: "5000"
source:
random:
sink:
- opensearch:
hosts: [ "https://localhost:9200" ]
insecure: true
username: <user>
password: <admin>
index: test
data-prepper-config.yaml
ssl: false
Docker command to run container:
docker run --name data-prepper \
-v C:/users/<profile>/documents/pipelines.yaml:/usr/share/data-prepper/pipelines.yaml \
-v C:/users/<profile>/documents/data-prepper.yaml:/usr/share/data-prepper/data-prepper-config.yaml \
opensearchproject/data-prepper:latest
logs exerpt:
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2022-06-07T19:39:50,959 [main] INFO com.amazon.dataprepper.parser.config.DataPrepperAppConfiguration - Command line args: /usr/share/data-prepper/pipelines.yaml,/usr/share/data-prepper/data-prepper-config.yaml
2022-06-07T19:39:50,960 [main] INFO com.amazon.dataprepper.parser.config.DataPrepperArgs - Using /usr/share/data-prepper/pipelines.yaml configuration file
2022-06-07T19:39:54,599 [main] INFO com.amazon.dataprepper.parser.PipelineParser - Building pipeline [simple-sample-pipeline] from provided configuration
2022-06-07T19:39:54,600 [main] INFO com.amazon.dataprepper.parser.PipelineParser - Building [random] as source component for the pipeline [simple-sample-pipeline]
2022-06-07T19:39:54,624 [main] INFO com.amazon.dataprepper.parser.PipelineParser - Building buffer for the pipeline [simple-sample-pipeline]
2022-06-07T19:39:54,634 [main] INFO com.amazon.dataprepper.parser.PipelineParser - Building processors for the pipeline [simple-sample-pipeline]
2022-06-07T19:39:54,635 [main] INFO com.amazon.dataprepper.parser.PipelineParser - Building sinks for the pipeline [simple-sample-pipeline]
2022-06-07T19:39:54,635 [main] INFO com.amazon.dataprepper.parser.PipelineParser - Building [opensearch] as sink component
2022-06-07T19:39:54,643 [main] INFO com.amazon.dataprepper.plugins.sink.opensearch.OpenSearchSink - Initializing OpenSearch sink
2022-06-07T19:39:54,649 [main] INFO com.amazon.dataprepper.plugins.sink.opensearch.ConnectionConfiguration - Using the username provided in the config.
2022-06-07T19:39:54,789 [main] INFO com.amazon.dataprepper.plugins.sink.opensearch.ConnectionConfiguration - Using the trust all strategy
2022-06-07T19:39:54,881 [main] ERROR com.amazon.dataprepper.plugin.PluginCreator - Encountered exception while instantiating the plugin OpenSearchSink
java.lang.reflect.InvocationTargetException: null
-----
Caused by: java.net.ConnectException: Connection refused
I am trying to setup drillv1.18 running. Facing the error below.
The drill-override.conf points to the zookeeper which runs on port 12181. On starting in distributed mode, it fails with the following log output. But the embedded mode has no issues.
It appears like permission issue, but both zookeeper, drill, zookeeper data-dir all are running under the same user.
2020-05-10 16:23:01,160 [main] DEBUG o.apache.drill.exec.server.Drillbit - Construction started.
2020-05-10 16:23:01,448 [main] DEBUG o.a.d.e.c.zk.ZKClusterCoordinator - Connect localhost:12181, zkRoot drill, clusterId: drillbits1
2020-05-10 16:23:01,531 [main] INFO o.a.d.e.s.s.PersistentStoreRegistry - Using the configured PStoreProvider class: 'org.apache.drill.exec.store.sys.store.provider.ZookeeperPersistentStoreProvider'.
2020-05-10 16:23:01,718 [main] DEBUG o.a.drill.exec.ssl.SSLConfigServer - Using Hadoop configuration for SSL
2020-05-10 16:23:01,718 [main] DEBUG o.a.drill.exec.ssl.SSLConfigServer - Hadoop SSL configuration file: ssl-server.xml
2020-05-10 16:23:01,731 [main] DEBUG org.apache.drill.exec.ssl.SSLConfig - Initialized SSL context.
2020-05-10 16:23:01,731 [main] INFO o.a.drill.exec.rpc.user.UserServer - Rpc server configured to use TLS protocol 'TLSv1.2'
2020-05-10 16:23:01,738 [main] INFO o.apache.drill.exec.server.Drillbit - Construction completed (577 ms).
2020-05-10 16:23:01,738 [main] DEBUG o.apache.drill.exec.server.Drillbit - Startup begun.
2020-05-10 16:23:01,738 [main] DEBUG o.a.d.e.c.zk.ZKClusterCoordinator - Starting ZKClusterCoordination.
2020-05-10 16:23:03,775 [main] ERROR o.apache.drill.exec.server.Drillbit - Failure during initial startup of Drillbit.
org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for /drill
at org.apache.zookeeper.KeeperException.create(KeeperException.java:106)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:54)
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:1538)
at org.apache.curator.utils.ZKPaths.mkdirs(ZKPaths.java:351)
at org.apache.curator.framework.imps.ExistsBuilderImpl$2.call(ExistsBuilderImpl.java:230)
at org.apache.curator.framework.imps.ExistsBuilderImpl$2.call(ExistsBuilderImpl.java:224)
at org.apache.curator.connection.StandardConnectionHandlingPolicy.callWithRetry(StandardConnectionHandlingPolicy.java:67)
at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:81)
at org.apache.curator.framework.imps.ExistsBuilderImpl.pathInForeground(ExistsBuilderImpl.java:221)
at org.apache.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:206)
at org.apache.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:35)
at org.apache.curator.framework.imps.CuratorFrameworkImpl.createContainers(CuratorFrameworkImpl.java:265)
at org.apache.curator.framework.EnsureContainers.internalEnsure(EnsureContainers.java:69)
at org.apache.curator.framework.EnsureContainers.ensure(EnsureContainers.java:53)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.ensurePath(PathChildrenCache.java:596)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.rebuild(PathChildrenCache.java:327)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.start(PathChildrenCache.java:304)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.start(PathChildrenCache.java:252)
at org.apache.curator.x.discovery.details.ServiceCacheImpl.start(ServiceCacheImpl.java:99)
at org.apache.drill.exec.coord.zk.ZKClusterCoordinator.start(ZKClusterCoordinator.java:145)
at org.apache.drill.exec.server.Drillbit.run(Drillbit.java:220)
at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:584)
at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:554)
at org.apache.drill.exec.server.Drillbit.main(Drillbit.java:550)
Version 1.17 has no issues in starting in distributed mode.
The issue here is with the zookeeper version. Perhaps you use 3.4.X version, but the current version of Drill requires 3.5.X. As a workaround, you may replace zookeeper jar in jars/ext/zookeeper-3.5.7.jar and jars/ext/zookeeper-jute-3.5.7.jar with the jars that corresponds to your zookeeper version.
In Addition to the answer of Vova Vysotskyi, you may find more information in Drill documentation about this issue:
https://drill.apache.org/docs/distributed-mode-prerequisites/
Starting in Drill 1.18 the bundled ZooKeeper libraries are upgraded to version 3.5.7, preventing connections to older (< 3.5) ZooKeeper clusters. In order to connect to a ZooKeeper < 3.5 cluster, replace the ZooKeeper library JARs in ${DRILL_HOME}/jars/ext with zookeeper-3.4.x.jar then restart the cluster.
I am getting this error. Tried two jar files into src folder, project folder etc too. Please check and help.
Tried Hibernate 3.6.4 and 5.4.2 both in different projects.
294 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.6.4.Final
297 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
303 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
311 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
446 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
446 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
1330 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
1476 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: org.SecondHibernateProject.dto.UserDetails
1550 [main] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity org.SecondHibernateProject.dto.UserDetails on table UserDetails
1629 [main] INFO org.hibernate.cfg.Configuration - Hibernate Validator not found: ignoring
1635 [main] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
1647 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
1647 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 1
1647 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
1678 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: org.postgresql.Driver at URL: jdbc:pstgresql://localhost:5432/hibernatedb
1678 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=admin, password=****}
1680 [main] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection to query metadata
java.sql.SQLException: No suitable driver found for jdbc:pstgresql://localhost:5432/hibernatedb
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:113)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
at org.vishal.hibernate.HibernateTest2.main(HibernateTest2.java:12)
1742 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.PostgreSQLDialect
1760 [main] INFO org.hibernate.engine.jdbc.JdbcSupportLoader - Disabling contextual LOB creation as connection was null
1762 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
1764 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
1764 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
1764 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
1765 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: disabled
1765 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
1765 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
1766 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
1767 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
1767 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
1767 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
1767 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
1770 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
1771 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
1771 [main] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
1772 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
1772 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
1773 [main] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
1777 [main] INFO org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge - Cache provider: org.hibernate.cache.NoCacheProvider
1778 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
1778 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
1784 [main] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
1785 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
1785 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
1786 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
1786 [main] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
1786 [main] INFO org.hibernate.cfg.SettingsFactory - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
1868 [main] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
1882 [main] INFO org.hibernate.type.BasicTypeRegistry - Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType#35fc6dc4
2572 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
2584 [main] INFO org.hibernate.tool.hbm2ddl.SchemaExport - Running hbm2ddl schema export
2585 [main] INFO org.hibernate.tool.hbm2ddl.SchemaExport - exporting generated schema to database
2585 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - schema export unsuccessful
java.sql.SQLException: No suitable driver found for jdbc:pstgresql://localhost:5432/hibernatedb
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:263)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:219)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:372)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
at org.vishal.hibernate.HibernateTest2.main(HibernateTest2.java:12)
2659 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08001
2659 [main] ERROR org.hibernate.util.JDBCExceptionReporter - No suitable driver found for jdbc:pstgresql://localhost:5432/hibernatedb
Exception in thread "main" org.hibernate.exception.JDBCConnectionException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:99)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
at org.vishal.hibernate.HibernateTest2.main(HibernateTest2.java:14)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:pstgresql://localhost:5432/hibernatedb
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
... 5 more
My hibernate configuration file looks like:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database Connection Settings
-->
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.url">jdbc:pstgresql://localhost:5432/hibernatedb</property>
<property name="connection.username">admin</property>
<property name="connection.password">admin</property>
<!-- JDBC Connection pool (use the build-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<!-- Disable Second level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database on startup -->
<property name="hbm2ddl.auto">create</property>
<!-- Names the annotated entity class -->
<mapping class="org.SecondHibernateProject.dto.UserDetails" />
</session-factory>
</hibernate-configuration>
And the Main Java Class is as below:
package org.vishal.hibernate;
import org.SecondHibernateProject.dto.UserDetails;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;;
public class HibernateTest2 {
public static void main(String[] args) {
UserDetails user = new UserDetails();
user.setUserId(1);
user.setUserName("First User");
SessionFactory sessionFactory=new Configuration().configure().buildSessionFactory();
Session session= sessionFactory.openSession();
session.beginTransaction();
session.save(user);
session.getTransaction().commit();
}
}
Could you please refer the given steps to fix this issue.
To download the PostgreSQL jar from the given path as per version.
https://jdbc.postgresql.org/download.html
Add the jar to the project by using "external jar" option in eclipse.
Verify the classpath and URL path of PostgreSQL DB.
Make sure that the "hibernate.cfg.xml" file should be placed at the root of "src"
folder if you are using given code for reading this file.
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
If the "hibernate.cfg.xml" located at a different location then read this file from the given path.
SessionFactory sessionFactory = new Configuration().configure("/path/to/hibernate.cfg.xml").buildSessionFactory();
Getting error while reading network stream from a successful socket connection. PL see the debug log from orient DB:
2016-04-08 18:08:51:590 WARNI Not enough physical memory available for DISKCACHE: 1,977MB (heap=494MB). Set lower Maximum Heap (-Xmx setting on JVM) and restart OrientDB. Now
running with DISKCACHE=256MB [orientechnologies]
2016-04-08 18:08:51:606 INFO OrientDB config DISKCACHE=-566MB (heap=494MB os=1,977MB disk=16,656MB) [orientechnologies]
2016-04-08 18:08:51:809 INFO Loading configuration from: C:/inetpub/wwwroot/orientdb-2.1.5/config/orientdb-server-config.xml... [OServerConfigurationLoaderXml]
2016-04-08 18:08:52:292 INFO OrientDB Server v2.1.5 (build 2.1.x#r${buildNumber}; 2015-10-29 16:54:25+0000) is starting up... [OServer]
2016-04-08 18:08:52:370 INFO Databases directory: C:\inetpub\wwwroot\orientdb-2.1.5\databases [OServer]
2016-04-08 18:08:52:495 INFO Listening binary connections on 127.0.0.1:2424 (protocol v.32, socket=default) [OServerNetworkListener]
2016-04-08 18:08:52:511 INFO Listening http connections on 127.0.0.1:2480 (protocol v.10, socket=default) [OServerNetworkListener]
2016-04-08 18:08:52:573 INFO Installing dynamic plugin 'studio-2.1.zip'... [OServerPluginManager]
2016-04-08 18:08:52:838 INFO Installing GREMLIN language v.2.6.0 - graph.pool.max=50 [OGraphServerHandler]
2016-04-08 18:08:52:838 INFO [OVariableParser.resolveVariables] Error on resolving property: distributed [orientechnologies]
2016-04-08 18:08:52:854 INFO Installing Script interpreter. WARN: authenticated clients can execute any kind of code into the server by using the following allowed languages:
[sql] [OServerSideScriptInterpreter]
2016-04-08 18:08:52:854 INFO OrientDB Server v2.1.5 (build 2.1.x#r${buildNumber}; 2015-10-29 16:54:25+0000) is active. [OServer]
2016-04-08 18:08:57:986 INFO /127.0.0.1:49243 - Connected [OChannelBinaryServer]
2016-04-08 18:08:58:002 INFO /127.0.0.1:49243 - Writing short (2 bytes): 32 [OChannelBinaryServer]
2016-04-08 18:08:58:002 INFO /127.0.0.1:49243 - Flush [OChannelBinaryServer]
2016-04-08 18:08:58:002 INFO /127.0.0.1:49243 - Reading byte (1 byte)... [OChannelBinaryServer]
Using OrientDB .Net binary (C# driver) in Windows Vista. This was working fine until recently. Not sure what broke it...
Resetting TCP/IP using NetShell utility did not help.
Any help is highly appreciated.
The problem was with the AVG anti-virus program that is blocking the socket. Added an exception in the program for localhost to fix the problem.
I wanted to lern xtext, for many years i lerned xpand and xtend and worked fine, but xtext seems to replaced the other both. And the xtext way looks fine to me.
As start i read follwing Tutorials: http://www.eclipse.org/Xtext/documentation/101_five_minutes.html, Including "15 Minutes Tutorial" and "15 Minutes Tutorial - Extended" and others. So i created a simple "Model"
grammar org.bs.test.Test with org.eclipse.xtext.common.Terminals
generate Test "http://www.bs.org/test/Test"
Test:
main=TMain;
TMain:
'main' name=ID
'done';
Generated on following way: "GenerateTest.mwe2" > right click > 'Run As' → 'MWE2 Workflow'.
Then made a copy of the Project. It was already my second or third try to find out what i made wrong.
Now i changed in the model following line: "main=TMain;" to "main=TMain?;". Then i used 'MWE2 Workflow' again, which run successful, but after running following happens:
Everthing files under 'src-gen/org/bs/test/Test/' and files in the subfolders 'impl' and 'util' are deleted. So they get deleted, then i copied the saved project and try following action on "Test.xtext" > right click > 'Run As' → 'Generate Xtext Artifacts', which result in the same.
There are two question for me:
1) What is the difference between "Generate Xtext Artifacts" and "MWE2 Workflow" and when did i do need them. I cannot figure that out on the Tutorial and especialy when to use them.
2) What did i wrong, and what i have to do to create generate the elements from the changed model
I could not find much on this, i hope someone could help me. I did not find something to both question.
EDIT 1:
When i create a complete new test project it works:
project name: org.test
name: org.test.MyTest
extensions: mytest
with following xtext:
grammar org.test.MyTest with org.eclipse.xtext.common.Terminals
generate myTest "http://www.test.org/MyTest"
Test:
main=TMain;
TMain:
'main' name=ID
'done'
But when i do the same with following input:
Project name: org.bs.craass
Name: org.bs.craass.CraAss
Extension: craass
xtext:
grammar org.bs.craass.CraAss with org.eclipse.xtext.common.Terminals
generate craAss "http://www.bs.org/craass/CraAss"
CraAss:
main=CAMain;
CAMain:
'main' name=ID
'done';
Later i will try following: install a new eclispe emf and create a new workspace.
EDIT2:
So i tested a new workspace, there it look liks, that it is working. Perhaps something with the old workspace. Like in a comment, in the orginal workspace, after i get a good "version", i wanted to put it on git (learning reason). Since then this not working anymore. Here some output of the generation:
0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri 'C:\workspaces\emf_01'
401 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project org.bs.craass at 'file:/C:/workspaces/emf_01/org.bs.craass/' and using 'file:/C:/workspaces/emf_01/error_01/org.bs.craass/' instead.
926 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project org.bs.craass at 'file:/C:/workspaces/emf_01/error_01/org.bs.craass/' and using 'file:/C:/workspaces/emf_01/org.bs.craass/' instead.
939 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project org.bs.craass.sdk at 'file:/C:/workspaces/emf_01/error_01/org.bs.craass.sdk/' and using 'file:/C:/workspaces/emf_01/org.bs.craass.sdk/' instead.
970 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project org.bs.craass.tests at 'file:/C:/workspaces/emf_01/error_01/org.bs.craass.tests/' and using 'file:/C:/workspaces/emf_01/org.bs.craass.tests/' instead.
1090 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project org.bs.craass.ui at 'file:/C:/workspaces/emf_01/error_01/org.bs.craass.ui/' and using 'file:/C:/workspaces/emf_01/org.bs.craass.ui/' instead.
1749 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project org.bs.craass at 'file:/C:/workspaces/emf_01/org.bs.craass/' and using 'file:/C:/workspaces/emf_01/save_01/org.bs.craass/' instead.
1762 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project org.bs.craass.sdk at 'file:/C:/workspaces/emf_01/org.bs.craass.sdk/' and using 'file:/C:/workspaces/emf_01/save_01/org.bs.craass.sdk/' instead.
1820 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project org.bs.craass.tests at 'file:/C:/workspaces/emf_01/org.bs.craass.tests/' and using 'file:/C:/workspaces/emf_01/save_01/org.bs.craass.tests/' instead.
2082 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Skipping conflicting project org.bs.craass.ui at 'file:/C:/workspaces/emf_01/org.bs.craass.ui/' and using 'file:/C:/workspaces/emf_01/save_01/org.bs.craass.ui/' instead.
2577 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.xbase.XbasePackage'
4253 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
4265 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
4335 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
4335 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
6234 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
6267 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf_01\org.bs.craass\..\org.bs.craass\src-gen
6326 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf_01\org.bs.craass\..\org.bs.craass\model\generated
6330 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf_01\org.bs.craass\..\org.bs.craass.ui\src-gen
6378 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf_01\org.bs.craass\..\org.bs.craass.tests\src-gen
9146 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.bs.org/craass/CraAss' from 'file:/C:/workspaces/emf_01/org.bs.craass/model/generated/CraAss.genmodel'
15709 [main] INFO text.generator.junit.Junit4Fragment - generating Junit4 Test support classes
15731 [main] INFO text.generator.junit.Junit4Fragment - generating Compare Framework infrastructure
15973 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
I compared with a run in a other workspace, and the WARN, does not come there. To be hornest, i ignored first, because it was "only" warnings. A run that runs successful:
0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri 'C:\workspaces\emf'
541 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.xbase.XbasePackage'
1020 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
1031 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
1064 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
1064 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
2307 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
2355 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf\org.bs.craass\..\org.bs.craass\src-gen
2382 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf\org.bs.craass\..\org.bs.craass\model\generated
2390 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf\org.bs.craass\..\org.bs.craass.ui\src-gen
2407 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf\org.bs.craass\..\org.bs.craass.tests\src-gen
4446 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.bs.org/craass/CraAss' from 'platform:/resource/org.bs.craass/model/generated/CraAss.genmodel'
11647 [main] INFO text.generator.junit.Junit4Fragment - generating Junit4 Test support classes
11719 [main] INFO text.generator.junit.Junit4Fragment - generating Compare Framework infrastructure
11997 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
So far the stand of my troubleshooting.
EDIT 3:
I do not know why, but it accept now the old xtext file i created and while running it occurs following error (but seems to have no big impact), complete log:
0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri 'C:\workspaces\emf'
664 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.xbase.XbasePackage'
1864 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
1882 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
1987 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
1987 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
3982 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
4018 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf\org.bs.craass\..\org.bs.craass\src-gen
4061 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf\org.bs.craass\..\org.bs.craass\model\generated
4064 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf\org.bs.craass\..\org.bs.craass.ui\src-gen
4087 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\workspaces\emf\org.bs.craass\..\org.bs.craass.tests\src-gen
7153 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.bs.org/craass/CraAss' from 'platform:/resource/org.bs.craass/model/generated/CraAss.genmodel'
error(208): ../org.bs.craass/src-gen/org/bs/craass/parser/antlr/internal/InternalCraAss.g:1199:1: The following token definitions can never be matched because prior tokens match the same input: RULE_INT
error(208): ../org.bs.craass.ui/src-gen/org/bs/craass/ui/contentassist/antlr/internal/InternalCraAss.g:2688:1: The following token definitions can never be matched because prior tokens match the same input: RULE_INT
16642 [main] INFO text.generator.junit.Junit4Fragment - generating Junit4 Test support classes
16661 [main] INFO text.generator.junit.Junit4Fragment - generating Compare Framework infrastructure
16804 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
The trouble seems, that i have following:
grammar org.bs.craass.CraAss with org.eclipse.xtext.common.Terminals
but on the other side:
terminal INTEGER : '-'?('0'..'9')+;
terminal VAR_TERMINAL : '_' ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
terminal REGISTER_TERMINAL : ('ax' | 'bx' );
terminal FUNCTION_TERMINAL : (('a'..'z'|'_'|'0'..'9')*'.')?('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
And in the org.eclipse.xtext.common.Terminals is
terminal INT returns ecore::EInt: ('0'..'9')+;
But i have no what to do with it.
The Problem itself, while generating everthing in srce-gen/, except the generated java files under src-gen/org.bs.craass.craAss and subfolder. Now there are created, too. So more i try to find out, so less the error was reproducable. Well, i will see, when i push it to git again, perhaps the error comes back.
So far thanks
running the workflow directly or calling generate language artefacts does the very same. the workflow reads your Xtext file and generates all infrastructure Xtext provides for your language. thus you have to call it if you change your grammar or the workflow itself. if you have a misconfiguration on your language or a broken grammar the generation may fail. also the workflow may refer to project names which may have to be adopted as well (dont know how you do the copy and paste - you should use the Xtext Project wizard to create the project to be safe)