Old netbeans web app with woodstock - java

I am having pretty much this same issue:
JavaEE/NetBeans Library Referencing
I have done what is suggested by downloading Netbeans 6.7 and Glassfish 2, but I still don't have the libraries needed.
Here's what one of my files looks like:
import com.sun.data.provider.RowKey;
import com.sun.data.provider.impl.CachedRowSetDataProvider;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.sql.rowset.CachedRowSetXImpl;
import com.sun.webui.jsf.component.Body;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.DropDown;
import com.sun.webui.jsf.component.Form;
import com.sun.webui.jsf.component.Head;
import com.sun.webui.jsf.component.Html;
import com.sun.webui.jsf.component.Label;
import com.sun.webui.jsf.component.Link;
import com.sun.webui.jsf.component.MessageGroup;
import com.sun.webui.jsf.component.Page;
import com.sun.webui.jsf.component.StaticText;
import com.sun.webui.jsf.component.TextField;
import com.sun.webui.jsf.model.SingleSelectOptionsList;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.FacesException;
import javax.faces.component.UISelectItems;
import javax.faces.component.html.HtmlSelectOneMenu;
import javax.faces.event.ValueChangeEvent;
import javax.sql.rowset.CachedRowSet;
I do not have any of the com.sun... packages and can't seem to find them anywhere.
I don't have very much experience with web apps/netbeans so any help would be appreciated. I realize that this is very outdated and should probably be migrated to something else, but for now I'd like to just make a few small edits and would rather not rewrite everything.
Thanks!

I originally had opened the project in a newer version of Netbeans that didn't have Wodostock/JSF. For some reason, it wouldn't work when opening with the older version of Netbeans. However, after deleting it and opening it again with the old version first, it worked.

Related

How to upgrade javax.naming.* and javax.xml.* imports to be compatible with java 10

I have a java project built with maven and jdk 1.8. Some classes use javax.naming.* and javax.xml.* classes in the jdk.
From Java 9 onwards those javax packages have been removed from the jdk. So how do I upgrade the project to run on java 9 or later?
Here are the classes,
import javax.naming.Binding;
import javax.naming.Context;
import javax.naming.Name;
import javax.naming.NameClassPair;
import javax.naming.NameParser;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.NoInitialContextException;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.ModificationItem;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.naming.event.EventContext;
import javax.naming.event.EventDirContext;
import javax.naming.event.NamingListener;
import javax.naming.ldap.Control;
import javax.naming.ldap.ExtendedRequest;
import javax.naming.ldap.ExtendedResponse;
import javax.naming.ldap.LdapContext;
import javax.naming.spi.InitialContextFactory;
import javax.naming.spi.InitialContextFactoryBuilder;
import javax.naming.spi.NamingManager;
import javax.xml.namespace.QName;
I have found out jndi contains javax.naming.* classes. But I am not sure how to include them. Just adding as a maven dependency does not work.
These classes have not been removed, see the JavaDoc for javax.naming and javax.xml.namespace. Unless you are building a module and forgot to add the modules java.xml and java.naming as dependencies, the mistake lies outside of Java, most likely with the tooling.
To convince yourself, compile a simple class on the command line with javac and watch it work. Then make sure you are running recent versions of the involved tools (particularly build tool and IDE). If that's the case and the error persists, improve your question with a more detailed description of the error.

Can't import Eclipse Datatools

I am just trying to import the datatools of eclipse after I installed the necessary plugins for the DTP (DTP, GEF and EMF + XSD).
Eclipse keeps on telling me, that the import cannot be found.
Actually, I am not even able to import ANYTHING from org.eclipse.*
Help appreciated!!
import org.eclipse.datatools.modelbase.sql.query.ValueExpressionColumn;
import org.eclipse.datatools.modelbase.sql.query.helper.StatementHelper;
import org.eclipse.datatools.sqltools.parsers.sql.SQLParseErrorInfo;
import org.eclipse.datatools.sqltools.parsers.sql.SQLParserException;

Google Cloud Messaging Smack Library

I am attempting to implement the Google Cloud Messaging CCS server written in Java, and I have downloaded the Smack library from here. My question is, which files do I place within my project in order to use these import statement?
import java.io.IOException;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.ConnectionConfiguration.SecurityMode;
import org.jivesoftware.smack.ConnectionListener;
import org.jivesoftware.smack.PacketInterceptor;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.filter.PacketTypeFilter;
import org.jivesoftware.smack.packet.DefaultPacketExtension;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smack.util.StringUtils;
import org.xmlpull.v1.XmlPullParser;
import org.jivesoftware.smack.SmackException;
You need to download the required libraries and import them into your project
I needed
Smack
JsonSimple
XmlPull 1.1.4.c
(Click for download links)
Once you've downloaded each library you need to import them into netbeans
Open your projects properties
Select Libraries
Select Add Library
Select Create
Add a name that indicates which library this is i.e Smack or JsonSimple so on
Add the jar, javadoc and sources if you downloaded them for each library
Rinse and repeat till all three libraries are added to your project

import org.jsoup.* not working

I try to make a java app using Jsoup.
Instead of using
(A)
import org.jsoup.Jsoup;
import org.jsoup.helper.Validate;
import org.jsoup.helper.Validate;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
I want to use
(B)
import org.jsoup.*;
(A) is working but (B) is not...
I am using IntelliJ and imported the dependencies...
Why is this not working ?
You should import each package like this:
import org.jsoup.*;
import org.jsoup.helper.*;
import org.jsoup.nodes.*;
import org.jsoup.select.*;
Since org.jsoup and org.jsoup.helper are different packages, you should import them separately.
In Eclipse, there is a function called Organize Import, perhaps there is similar functionality in InteliJ.

Where to install the import modules used in a java program?

For a program the import headers are showing errors. From where can i download the importing packages? The import instance of the program is shown below..
package com.larmor.opencv.samples;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Panel;
import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import javax.media.Buffer;
import javax.media.CaptureDeviceInfo;
import javax.media.CaptureDeviceManager;
import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.Player;
import javax.media.control.FrameGrabbingControl;
import javax.media.format.VideoFormat;
import javax.media.util.BufferToImage;
import javax.swing.JButton;
import javax.swing.JComponent;
import com.larmor.opencv.MatchTemplate;
would this all be in the java library? Even if yes pls tell me how to install packages/modules that are not in the java library..
Most of those classes are available in JSE, but it looks like it's also using JMF. You can download JMF from here:
JMF Download
You don't install modules, you just add jars/classes to the classpath. How you do that depends on if you are using an IDE or not. This article can give you some insight on how things work:
PATH and CLASSPATH
All the java.awt and javax.swing classes are part of the standard Java platform.
The javax.media classes are part of the Java Media Framework. You'd have to download and install that separately.
The MatchTemplate thing seems to come from here.
To find where a package come from, look through the Java SE API documentation or search for the package name on Google.
You need to put the relevant JAR files to your classpath while compiling and running your application which uses these classes (except if they are classes in the standard Java platform; these will be automatically available).

Categories

Resources