• Post Reply Bookmark Topic Watch Topic
  • New Topic

REST Framework That Doesn't Use Maven?  RSS feed

 
Ranch Hand
Posts: 1511
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Due to an issue where IBM SPSS requires you leave their "Java JAR" in the installation directory (not part of the Maven JAR or WAR), I don't seem to be able to use a Maven type architecture given this severe constraint. I've tried various pom.xml ideas and even tried loading the JAR classes dynamically, using Reflection, at run time. No dice.

I'm therefore wondering if there are other non-Maven-based REST services (I haven't found any: Jersey, SparkJava, ...) that don't use Maven?

Just wondering what my options might be.

Thanks,

-- mike

 
Ranch Foreman
Posts: 1031
30
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think (could be wrong) but isn't Maven used for build management

https://maven.apache.org/ wrote:Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.


I'm not too sure how a build management system would interfere with REST services.

From what I've gathered Gradle can do most (all?) of what Maven does so maybe this is an alternative that you can use.
Gradle can be found here https://gradle.org/
 
Mike London
Ranch Hand
Posts: 1511
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pete Letkeman wrote:I think (could be wrong) but isn't Maven used for build management

https://maven.apache.org/ wrote:Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.


I'm not too sure how a build management system would interfere with REST services.

From what I've gathered Gradle can do most (all?) of what Maven does so maybe this is an alternative that you can use.
Gradle can be found here https://gradle.org/



It's not that the build management is interfering with REST services. The problem is that since a critical JAR file can't be put into the Maven repo, or included in the executable JAR, or loaded dynamically, there's no apparent way to use Maven. IBM requires their Java JAR remain (not be in an executable JAR or in a Maven Repo) in the SPSS installation folder.

I'm afraid Gradle would have the same issues given these constraints, correct?

Thanks,

- mike
 
Sheriff
Posts: 11598
187
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This search might turn up something helpful for you maven specify non-standard location for jar file dependency
 
Mike London
Ranch Hand
Posts: 1511
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Junilu Lacar wrote:This search might turn up something helpful for you maven specify non-standard location for jar file dependency



Unfortunately, I don't think there's anything here that I haven't seen and tried.

The IBM SPSS JAR must remain in their installation folder, not part of a Maven-generated JAR.

If I merely point to that JAR file, as in one or your linked pages: <systemPath>${lib.location}/MyLibrary.jar</systemPath>

this technique does work in the IDE, but at runtime (trying to load the JAR), you still get ClassNotFound Exceptions.

Using reflection in a SpringBoot project doesn't overcome these errors either in my testing (trying to load the needed remote JAR classes with Class.ForName() at runtime).

---

Unless you can think of something I've overlooked, I think we need to do a tech support ticket with IBM.

Look forward to any suggestions.

Thanks,

- mike

 
Mike London
Ranch Hand
Posts: 1511
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the detailed investigation I did with the great help of Knute and others:

https://coderanch.com/t/685608/Confusing-maven-error-run-program

Thanks,

- mike
 
Ranch Hand
Posts: 941
9
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mike London wrote:Due to an issue where IBM SPSS requires you leave their "Java JAR" in the installation directory (not part of the Maven JAR or WAR), I don't seem to be able to use a Maven type architecture given this severe constraint. I've tried various pom.xml ideas and even tried loading the JAR classes dynamically, using Reflection, at run time. No dice.


Sorry Mike, what are you trying to do? It's not clear -at least to me -what is the problem you are facing. You want to use SPSS jars in a project of yours? What else?
 
Mike London
Ranch Hand
Posts: 1511
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Claude,

Thanks for your posting.

Please check out the link to the JR topic I posted in the reply above yours for excruciating detail of the Mavenissues.

My posting in this forum was not meant to duplicate that posting, but instead to scope out other possible frameworks.

Thanks again,

- mike
 
Claude Moore
Ranch Hand
Posts: 941
9
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've read very quickly your original post and I think that Dave Tolls is right, for some obscure reason SPSS needs to launch a script located in SPSS installation folder and/or access other resources it assumes to be in installation path.  I never used Spss myself, but I ran in similar problems years ago with Websphere appserver. In that case,  I had to use what IBM  used to define an "application client runtime", i.e a bunch of jars you can use on client site to interact natively with a WAS instance running elsewhere (for example, to use ejbs stub, remoting and so on) I wonder if something similar applies to SPpS as well. It's just a guess tough.
 
Claude Moore
Ranch Hand
Posts: 941
9
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pretty sure you have already got it, but check documentation at this link
. This document tells about an SDK you should use or install, maybe you have to work with jars Tha SDK provides.
 
Ranch Foreman
Posts: 3137
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said on the other thread, you have two issues.
First is compilation, and there's no reason you can't stick the jar file in your repo for that (compile only).
You don't want it included in any jar or war.

The second is getting Spring Boot to find the jar file, and I did suggest using one (or other) of the SB-specific MANIFEST tags to add the installation location.

Now, this does mean having a fixed installation location...there may be a way around that, but at least you'd have a running app as a start point.
 
Mike London
Ranch Hand
Posts: 1511
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:As I said on the other thread, you have two issues.
First is compilation, and there's no reason you can't stick the jar file in your repo for that (compile only).
You don't want it included in any jar or war.

The second is getting Spring Boot to find the jar file, and I did suggest using one (or other) of the SB-specific MANIFEST tags to add the installation location.

Now, this does mean having a fixed installation location...there may be a way around that, but at least you'd have a running app as a start point.



Thanks Dave. Really only one issue.

Compilation has never been a problem. All the code in Intellij compiles, and the JAR builds with no errors.

However if loading the class files dynamically at runtime using reflection doesn't work, we don't want to resort to mucking with the MANFIEST file.

I really appreciate all your help with this issue.
 
Dave Tolls
Ranch Foreman
Posts: 3137
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I would consider altering the MANIFEST as less of a "mucking about" than loading via reflection, but since you say (in the other thread) that you're looking at an alternative to SPSS then it's a bit moot.
 
Mike London
Ranch Hand
Posts: 1511
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:Well, I would consider altering the MANIFEST as less of a "mucking about" than loading via reflection, but since you say (in the other thread) that you're looking at an alternative to SPSS then it's a bit moot.



I did try your suggestion, actually, but may have misunderstood exactly what you meant.

Below's the MANIFEST I tried. Is this what you meant?

Manifest-Version: 1.0
Implementation-Title: spssdemo
Implementation-Version: 0.0.1-SNAPSHOT
Archiver-Version: Plexus Archiver
Built-By: mike
Implementation-Vendor-Id: com.company
Spring-Boot-Version: 1.5.7.RELEASE
Implementation-Vendor: Pivotal Software, Inc.
Main-Class: org.springframework.boot.loader.JarLauncher
Start-Class: com.company.spssdemo.SpssdemoApplication
Spring-Boot-Classes: BOOT-INF/classes/
Spring-Boot-Lib: BOOT-INF/lib/
Created-By: Apache Maven 3.3.9
Build-Jdk: 1.8.0_144
Implementation-URL: http://projects.spring.io/spring-boot/spssdemo/
Loader-Path: /Applications/IBMSPSSStatistics/Subscription/SPSSStatisticsSubscription.app/Contents/bin/spssjavaplugin.jar

Thanks,

-mike
 
Dave Tolls
Ranch Foreman
Posts: 3137
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That, or one of the other Spring Boot specific entries.
I didn't have much time to read them all, but I would be surprised if one of them didn't provide a way of adding to the SBoot classpath.
 
Mike London
Ranch Hand
Posts: 1511
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:That, or one of the other Spring Boot specific entries.
I didn't have much time to read them all, but I would be surprised if one of them didn't provide a way of adding to the SBoot classpath.



Okeydoke. I'll experiment time permitting and get back with any success.

Thanks very much Dave.

- mike
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!