• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

I need help rebuilding my ucanaccess project

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Although I have a programming background, i am mostly  self-taught.  I wrote an access app for my song lyrics and performances, and a java front-end to the database so i could use it on a tablet without clunky access.  I used Netbeans with ucanaccess library. I have used it happily for many years, adding features and updates as i went. I recently got a new awesome i9 computer and loaded netbeans, and went to compile my code and got all sorts of errors.  I believe i started with netbeans 8 all the way up to netbeans 14 and updated it regularly with no real problems.  I have now loaded netbeans 19 with java 20.0.2.

I will start with what might be my  final error, although i had to learn how to re-create the projects from source since my older project seemed to be borked.  the current error is : package net.proteanit.sql does not exist.  I have followed all the suggested ways of loading the jar file into my library, although it seems the terminology has changed  and I have not seen anything in google that helps me add a library to a netbeans project - most applies to eclipse.  Can anyone help?  
 
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

Are your projects built using Maven? If so, please share your POM with us. If not, consider migrating your projects to Maven.
 
Michael Wells
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.mycompany</groupId>
   <artifactId>giglist2</artifactId>
   <version>1.0-SNAPSHOT</version>
   <packaging>jar</packaging>
   <dependencies>
       <dependency>
           <groupId>com.github.gv2011</groupId>
           <artifactId>tools-backup</artifactId>
           <version>0.8</version>
           <type>jar</type>
       </dependency>
       <dependency>
           <groupId>com.healthmarketscience.jackcess</groupId>
           <artifactId>jackcess</artifactId>
           <version>1.2.14.3</version>
           <type>jar</type>
       </dependency>
       <dependency>
           <groupId>commons-dbutils</groupId>
           <artifactId>commons-dbutils</artifactId>
           <version>1.0</version>
           <type>jar</type>
       </dependency>
   </dependencies>
   <properties>
       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
       <maven.compiler.source>20</maven.compiler.source>
       <maven.compiler.target>20</maven.compiler.target>
       <exec.mainClass>com.mycompany.giglist2.Giglist2</exec.mainClass>
   </properties>        
</project>
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The net.proteanit.sql package appears to originate from some library named rs2xml. The problem is that this library is not available in the Central Maven repository.

I think what happened is that in your old project, you downloaded this JAR from somewhere and then manually added it to your NetBeans project, which at that time was not yet properly Mavenized.

Now, I don't really know what happened when you updated NetBeans, but I suspect that NetBeans no longer really supports hybrid projects. It's either Maven, or it's not. Since your new project uses Maven, and there is no artifact in the central Maven repository for this library, it complains that it can't find the net.proteanit.sql package.

You have two options:

If you still have the rs2xml JAR lying around somewhere, you can install it in your local Maven repository, and then refer to it from your POM. This is a quick short-term solution. In the long run, it will just lead to more headache.

The long-term solution is to get rid of this library altogether, and replace it with another one that is available to Maven. I very strongly suggest you pick this option, because I don't trust Java libraries that aren't available to Maven. It also reduces the chance of you running into this problem again in the future.

Can you explain what you used the library for? Maybe we can suggest an easy replacement.
 
Michael Wells
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks , I appreciate the responses and help. It seems like this was used by ucanaccess, and the call it used was DbUtils .. I did find another one called DbUtils, but now i get an error on this line: jTable1.setModel(DbUtils.resultSetToTableModel(rs));  so I suspect it's not the right one.  this is the one i tried: import org.apache.commons.dbutils.DbUtils;  I tried manually adding the rs2xml.jar but that is when i ran into the problem with netbeans 19 not having the same way of handling libraries.. i got totally confused because none under projects tab there is nothing called libraries, it is called dependencies,   And adding stuff to it is confusing.
 
Michael Wells
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this post seems to be similar, but again - i have nothing called libraries! so i can't remove and re-add.  : https://coderanch.com/t/715010/java/net-proteanit-sql#3345500
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Like I said, you have two options: Install rs2xml in your local Maven repository or dump it completely in favor of a different library. Trying to force NetBeans to use it in a different way won't help you.
 
Master Rancher
Posts: 4986
79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you don't have rs2xml.jar, it look like you can get a copy from this site:

https://sourceforge.net/projects/finalangelsanddemons/

I wouldn't put much trust in a project not in version control, so I would probably (a) install it in your local repository while using it to resolve compile errors, then (b) once the project is working (as much as possible), try to migrate to another library.  In other words, both options suggested by Stephan.
 
Michael Wells
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay well it looks like i've tried putting in rsxml manually, and that didn't work either.. i did find another DbUtils, but it must be different, becasue i get errors on open file..  so here's a final question.  Would it work to just back pedal and reinstall earlier versions of netbeans, and would i also have to back pedal on the jdk's?  Or would that library import still be unavailable?
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Wells wrote:okay well it looks like i've tried putting in rsxml manually, and that didn't work either


If you told us what you mean by "putting in rsxml manually" and "that didn't work", we could probably help you fix the issue.

so here's a final question.  Would it work to just back pedal and reinstall earlier versions of netbeans, and would i also have to back pedal on the jdk's?  Or would that library import still be unavailable?


No guarantee. There's absolutely no saying what made it work in the past. If you roll back all your tools and it doesn't work, then you're even further away from a good solution than you are now. Besides, do you feel that never updating your tools is really the way to go?
 
Michael Wells
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay , in Netbeans 19, what is the procedure to add rxsml.jar manually?  
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
NetBeans has nothing to do with it. You have to install the library in your Maven repository, and you have to tell Maven that you have a dependency on it.

To install the library in your local Maven repository, run this command:

After it succeeds, add the following dependency to your POM:
 
Michael Wells
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your help...  I FINALLY was able to compile it. See, the main problem is that after netbeans 12, the maven projects no longer had libraries, they only had dependencies that used that dopey pom.xml file.  Well imagine not knowing anything about that and just seeing that your imports that used to work no longer worked,  I decided to create a new project under ant simply because the ant projects still had freaking libraries.  Then I was able to locate the .jar files i needed and after adding all the .jar files, it worked!   I had to ask chatgpt if ucanaccess required maven, and it said "no" but you have to add all the jar files you need.  whew.. what a pain.  Thanks again.  
 
Michael Wells
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now i am able to start trying to figure out my original problem.. this java program was only meant as a lightweight interface that would run on a tablet, so i could load my song lyrics from my song database. It opens word when you click or touch a song file.  as long as the filename matches the song name in the database, it will open the doc file.  Well I put a form that allows me to add from the java program, and inserts the filename into the song table. But here is the problem: Although I add the record and it "looks" correct .. matches the filename perfectly, it doesn't find the file.   When opened in Access, the record in in the table and the filename look identical, but when clicked, the file is not found.  So anyway that was the reason i went to open the project in netbeans to see if i could troubleshoot that problem.  If you have any thoughts about that , let me know.  (unicode vs regular text?)
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a pity you took the Ant approach. Ant is on its way out, and it will become harder and harder for you to find online help for your projects if you stick with it. I strongly suggest that at some point, you invest some time in learning Maven. That "dopey" pom.xml file is a lot less dopey than the mess one can create for themselves with Ant build definitions.

Anyway, in order to get help with your new problem, show us the code you use to retrieve the file from the database.
 
Straws are for suckers. Now suck on this tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic