I m developing a plugin in Eclipse using Java , as plugin requirement I need to retrieve database table values in to my java class(Presently I m using SQL Server2008 database). I also added the jtds1.2.5.jar in libraries , still I m not able to get the results
can any one help me
Thanks in advance
The plug-in's classpath must be specified using the MANIFEST.MF file, whether that means a .jar file you're including in the plug-in or other plug-ins you depend upon. If NoClassDefFoundErrors are not why you can't get your JDBC results, it would help to give more information on the errors you're encountering.
Related
I recently tried to add the google tink library to eclipse and it always has a "com.google.protobuf.GeneratedMessageV3$ cannot be resolved" error, I normally never have any problems with adding libraries to my project, and from what I can tell it has something to do with the all key template files since the error only occours when I try to generate a new KeysetHandle with any key template, and the error only starts when i enter in the key template file# https://github.com/Gameidite/testProject
The Protobuf library can generate Java classes for you. You need to find where these .class files have been output to (eg there should be a GeneratedMessageV3$.class somewhere) and make sure that they are included on your classpath. There's presumably somewhere in Eclipse where you can configure where it looks for class files - you'll need to add the generated files there.
If the generated class files don't exist yet you need to figure out what to do to generate them. It might be easier to use Maven or Gradle as suggested in the Tink documentation rather than directly adding things to Eclipse.
I think it's probably because Eclipse cannot find the protobuf Java runtime. Have you tried adding Tink to your project with Maven or Gradle?
I have been working on creating a simple Java desktop app using the RESTful API for Business Objects and have run into an issue. Whenever I run my app in Eclipse in works fine; whenever I export it as a 'Runnable Jar' and select the Library handling option 'Package required libraries into generated JAR' it works fine. However, whenever I try to export it using the Library handling option 'Extract required libraries into generated JAR' I get the following error after running the app:
java.lang.NoClassDefFoundError: Could not initialize class com.businessobjects.bcm.BCM
I have the 'bcm.jar' file added under a 'res' Source Folder and have it added to the Build Path. At one point I added all the JARs under the 'SAP BusinessObjects' java folder, and external folder, but it still throws the error. The problem stems from this line of code:
enterpriseSession = CrystalEnterprise.getSessionMgr().logon(userID, password, CMS, auth);
Would anyone know why I am getting said error? I really want to use the Extract option as it will improve performance as my app becomes larger. Any help resolving this issue would be greatly appreciated :)
EDIT: I would be happy to provide clarification or further detail upon request!
Seems this was introduced in SP04 and SAP has no intent of fixing it as the RESTful API wasn't designed to be used with Desktop apps.
Have you included the cryptojFIPS.jar? Leaving it out can cause the error.
I have a problem with maven-dbunit-plugin.
The common use of maven-dbunit-plugin is running a command like mvn dbunit:operation in the shell.
But now, I have a spring batch job. The work of this job is writing data by sample-data.xml file to the database.
The command mvn dbunit:operation depends on the maven project with the pom.xml. This is not the style what I want.
How to write code using maven-dbunit-plugin lib to resolve this problem?
There is no straight anwser to your question, or there is at least some misunderstanding.
Even if it's not really impossible, you try to use a tool for another goal that why it was designed.
Maven : build tool
As per doc, maven a build and "project comprehension tool", aimed toleverage the management of softwares. In a few words : it's related to Build phase (development).
So, maven-dbunit-plugin provided features to help you during test / dev of your program : batch, webapp, .... or wathever you want.
Loading data
You are (or you seem) looking for a library that read data from an xml file, during Run Phase (production) and load them into a database.
There hopefully is a lot of way to achieve that, depending on your needs : do you have to make some operation on data before ? Which database are you using.
Here a few list of ideas :
Import Data into MySQL
http://www.mssqltips.com/sqlservertip/2899/importing-and-processing-data-from-xml-files-into-sql-server-tables/
INSERT INTO XMLwithOpenXML(XMLData, LoadedDateTime)
SELECT CONVERT(XML, BulkColumn) AS BulkColumn, GETDATE()
FROM OPENROWSET(BULK 'D:\OpenXMLTesting.xml', SINGLE_BLOB) AS x;
Import Data into SQL Server
Import XML file into SQL Server without BULK
SELECT *
FROM OPENROWSET('MSDASQL',
'Driver={Microsoft Text Driver (*.xml)};DefaultDir=C:\Radu\test.xml;',
'SELECT * FROM [test.xml];' )
As a last solution, you may use dbunit, as a dependency, and call internal method, but once again, this is not the main usage of this library.
I'm currently working on a Swing project that uses hsqldb 2.3 as an optional database...
This project has a map, and geotools also uses hsqldb, however it uses hsqldb 1.8.
I tried to put them both working together but I get this exception:
"Caused by: java.lang.ClassNotFoundException: org.hsqldb.jdbc.jdbcDataSource"
I checked the source code, and I believe the reason it happens is because on 2.3 the "jdbc" word is in upper case:
"org.hsqldb.jdbc.JDBCDataSource"
I don't know what to do from here. If I add both jars I will get a class conflict error.
Any suggestion is welcome....
It seems there are also some other dependencies on hsqldb 1.8. You can start by modifying GeoTools and changing references to the new class. The SQL statements in GeoTools scripts are generally compatible but some usage may need updating. You will find out if you get an error when the scripts are run.
https://github.com/geotools/geotools/tree/master/modules/plugin/epsg-hsql/src/main/java/org/geotools/referencing/factory/epsg
Note there is some use of CREATE ALIAS in source code which may be redundant and can be removed.
See the resources directory in the same source tree for the SQL.
EDIT This question is not about how to solve dependencies using Ant / Maven / Gradle or whatnots.
I'm trying to use Neo4j and I'm a bit confused by the docs as to what I need to embed a very simple "Hello, world!" Neo4j example in an app.
I've read in several places that Neo4j was lightweight and that only one (and now two) jars where needed.
For example here: http://highscalability.com/neo4j-graph-database-kicks-buttox
we can read: "Small footprint. Neo4j is a single <500k jar with one dependency (the Java Transaction API)."
This is precisely one of the reason I'm interested in Neo4j to embed it...
So I downloaded the community edition (GPL) of Neo4j and read the explanation here:
http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-setup.html
which says: "Extract a Neo4j download zip/tarball, and use the jar files found in the lib/ directory."
Now that's more than concise and I've found old messages saying that the "wording was changed". At one point all that Neo4j needed was one jar apparently (which is one of the reason I was interested in embedding Neo4j btw). But now apparently it's two, because there's a dependency on some Java Transaction API (which one? a .jar shipped with neo4j?)
The problem is that if I look in that lib/ dir I've got quite some things:
1115454 lib/neo4j-kernel-1.6.1.jar
153707 lib/neo4j-graph-algo-1.6.1.jar
222791 lib/neo4j-shell-1.6.1.jar
8865464 lib/scala-library-2.9.0-1.jar
43530 lib/neo4j-jmx-1.6.1.jar
590503 lib/neo4j-kernel-1.6.1-tests.jar
23954 lib/neo4j-community-1.6.1.jar
28023 lib/neo4j-udc-1.6.1.jar
1517975 lib/neo4j-cypher-1.6.1.jar
51662 lib/neo4j-graph-matching-1.6.1.jar
16030 lib/geronimo-jta_1.1_spec-1.1.1.jar
143177 lib/neo4j-lucene-index-1.6.1.jar
1466301 lib/lucene-core-3.5.0.jar
118875 lib/server-api-1.6.1.jar
92850 lib/org.apache.servicemix.bundles.jline-0.9.94_1.jar
And in system/lib:
27461 system/lib/blueprints-neo4j-graph-1.1.jar
72650 system/lib/jettison-1.3.jar
628626 system/lib/rrd4j-2.0.7.jar
17985 system/lib/asm-analysis-3.2.jar
177174 system/lib/jetty-util-6.1.25.jar
109043 system/lib/commons-io-1.4.jar
755981 system/lib/neo4j-server-1.6.1.jar
35910 system/lib/gremlin-java-1.4.jar
46367 system/lib/jsr311-api-1.1.1.jar
36551 system/lib/asm-util-3.2.jar
206035 system/lib/commons-beanutils-core-1.8.0.jar
227122 system/lib/jackson-core-asl-1.8.3.jar
33094 system/lib/asm-commons-3.2.jar
17308 system/lib/jcl-over-slf4j-1.6.1.jar
21878 system/lib/asm-tree-3.2.jar
12359 system/lib/log4j-over-slf4j-1.6.1.jar
.
. (skipped a few jars from system/lib here)
.
If my Emacs-fu is strong enough the jars above weight at nearly 17 MB (not that "embeddable")... And I didn't even paste all the jars from system/lib/.
So what is the minimum number of .jar (and which are they) do I need so that I can embed Neo4j and run a simple "Hello, world!" example?
I'm confused by the official doc saying: "... use the jar files found in the lib/ directory".
Surely I don't need all of them right?
Basically, you need only neo4j-kernel-1.6.1.jar (and the mentioned transaction API geronimo-jta_1.1_spec).
However, this will give you only the basic functionality. If you want to use other parts, like indexing, querying, management tools, etc., you would need other jars.
The absolute minimum to run the kernel is
neo4j-kernel.jar
jta.jar
The rest is Cypher, Lucene indexing and other stuff.