Re: Fwd: Can't get project to work with tomcat7

2022-01-09 Thread Mark Phillips
Mark,

That helps a lot.

I was able to manually start tomcat7, clean and build the site, and
manually deploy the war file, trap the exception, change one line of code
(add 33 characters), and the site works on my development machine.

I now need to get a large bottle of bourbon, drink 1/2 of it for courage,
deploy the new war file on my production server, and if it all works, then
finish the bottle in celebrationif it breaks, then, well...,  finish
the bottle anyway...

I am going to try to update the application to the latest standards (Java,
JSP, Tomcat) and see how far I get. I have to admit, I left java quite a
while ago for Python and the Django framework. I have thought of just
keeping the db and rebuilding the site from scratch using Django...but that
seems to be as large a project as updating the java site to the latest
versions of everythingpass the bourbon!

Mark

On Sun, Jan 9, 2022 at 3:54 PM Mark Eggers  wrote:

> Mark,
>
> Well, that is indeed it.
>
> You've told NetBeans that it's a J2EE 7 application (which Tomcat 7
> won't run), and the web.xml is servlet specification 2.4.
>
> You can try the following:
>
> in web.xml
>
> http://java.sun.com/xml/ns/javaee;
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;>
>
> In NetBeans->Properties->Run
>
> Java EE Version: Java EE 5.
>
> If you're using Maven, you'll still have to install a JDK 8 Java
> Platform under
> Tools->Java Platforms.
>
> I don't know if you're building under Maven or Ant, but you may also
> have to update the JSP API. From one of my Maven projects which is set
> for Java EE 5:
>
> servlet-api-2.5 (provided by Tomcat)
> jsp-api-2.1 (provided by Tomcat)
>
> I also use JSTL and tag libraries since I think scriptlets are evil
> (lack of exception management is at the top of their evilness).
>
> javax.servlet.jsp.jstl-api-1.2.2 (not provided by Tomcat)
> taglibs-standard-impl-1.2.5 (not provided by Tomcat, using the taglibs
> from Apache)
>
> That should be enough to get everything seen by NetBeans.
>
> You could bump things up to servlet spec 3.0.1 (Java EE 6) before
> running into a Tomcat 7 limitation. The process is similar, just with a
> different XSD and dependency set.
>
> Note that if you're running log4j 2.17.1 (or any log4j2, actually),
> you'll need to initialize it differently in Java EE 6 versus Java EE 5
> and below.
>
> I hope that gets you started.
>
> Mark
> /mde/
>
> On 1/9/2022 2:00 PM, Mark Phillips wrote:
> > -- Forwarded message -
> > From: Mark Phillips 
> > Date: Sun, Jan 9, 2022 at 2:58 PM
> > Subject: Re: Can't get project to work with tomcat7
> > To: Mark Eggers 
> > Cc: 
> >
> >
> >
> >
> > On Sun, Jan 9, 2022 at 1:27 PM Mark Eggers  >
> > wrote:
> >
> >> Mark,
> >>
> >> All the applications that we run work fine on Tomcat 7 - Tomcat 9 (after
> >> we modify context.xml). Most of our apps are pretty simple, but we do
> >> have a few with either complex calculations or complex REST APIs. Your
> >> challenges with Tomcat 9 should probably be taken up on the Tomcat
> >> mailing list (great place, BTW).
> >>
> >> If you go under Project->Properties->Run, what does the Java EE Version
> >> say? If you have a web.xml (most likely), what is the web-app version
> >> attribute value?
> >>
> >
> > Run properties = Java EE 7 Web
> > web-app = http://java.sun.com/xml/ns/j2ee;
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> xsi:schemaLocation="
> > http://java.sun.com/xml/ns/j2ee
> > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;>
> >
> >
> >>
> >> Just looking at the drop-down menu for Java EE Version, it doesn't look
> >> like NetBeans supports anything lower than Java EE 5. If you have a
> >> really old web application running servlet spec 2.4, NetBeans 12 may not
> >> recognize it.
> >>
> >
> > How do I update the servlet spec for my application?  Sounds like one
> place
> > to start upgrading my application?
> >
> >>
> >> In that case, you should be able to build your application in NetBeans
> >> 12, run Tomcat separately, and deploy using the manager application.
> >
> >
> >> Please note that if you use Maven and run NetBeans on Java 11, you'll
> >> need to configure a JDK 8 Java Platform (under tools).
> >>
> >> Technical debt is really dangerous. If t

Re: Can't get project to work with tomcat7

2022-01-09 Thread Mark Phillips
On Sun, Jan 9, 2022 at 1:27 PM Mark Eggers 
wrote:

> Mark,
>
> All the applications that we run work fine on Tomcat 7 - Tomcat 9 (after
> we modify context.xml). Most of our apps are pretty simple, but we do
> have a few with either complex calculations or complex REST APIs. Your
> challenges with Tomcat 9 should probably be taken up on the Tomcat
> mailing list (great place, BTW).
>
> If you go under Project->Properties->Run, what does the Java EE Version
> say? If you have a web.xml (most likely), what is the web-app version
> attribute value?
>

Run properties = Java EE 7 Web
web-app = http://java.sun.com/xml/ns/j2ee;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;>


>
> Just looking at the drop-down menu for Java EE Version, it doesn't look
> like NetBeans supports anything lower than Java EE 5. If you have a
> really old web application running servlet spec 2.4, NetBeans 12 may not
> recognize it.
>

How do I update the servlet spec for my application?  Sounds like one place
to start upgrading my application?

>
> In that case, you should be able to build your application in NetBeans
> 12, run Tomcat separately, and deploy using the manager application.


> Please note that if you use Maven and run NetBeans on Java 11, you'll
> need to configure a JDK 8 Java Platform (under tools).
>
> Technical debt is really dangerous. If there is a security issue with
> unsupported platforms, the resulting fire drill is unpleasant at best
> (speaking from personal work experiences).
>

I totally agreejust need more hours in the day! ;)

>
> . . . just my two cents
> /mde/
>
> On 1/9/2022 11:33 AM, Mark Phillips wrote:
> > Mark,
> >
> > My project is old, and is running on tomcat7 in production. It seems
> mysql
> > was updated on the production server, and now I cannot add data to
> > mysql/the application because of this error message:
> >
> > Generated keys not requested. You need to specify
> > Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate(),
> > Statement.executeLargeUpdate() or Connection.prepareStatement().
> >
> > I need to update the java files for db access, so I need netbeans to work
> > with this project so I can make a new .war file and update the production
> > server.
> >
> > I realize that I am using old stuff, but it works and I don't have time
> > right now to upgrade the entire site (launched in 2000). I tried running
> > the site on tomcat 9 when it came out, and there were too many issues to
> > resolve at that time, so I left it on tomcat7.
> >
> > I still think there is something screwy with netbeans if it will allow a
> > tomcat7 server to be added, and run, but won't associate it with a
> project.
> >
> > Thanks,
> >
> > Mark
> >
> >
> >
> >
> >
> > On Sun, Jan 9, 2022 at 10:39 AM Mark Eggers
> 
> > wrote:
> >
> >> Mark,
> >>
> >> What servlet specification is your project? Tomcat 7 (which is EOL BTW)
> >> will handle up to servlet specification 3.0 (J2EE 6 Web). Anything later
> >> will require a later version of Tomcat. Tomcat 9 is probably the best
> >> choice until you're ready to switch to the Jakarta namespace.
> >>
> >> . . . just my two cents
> >> /mde/
> >>
> >> On 1/9/2022 7:35 AM, Mark Phillips wrote:
> >>> Mark,
> >>>
> >>> I tried that. The problem is the server list in the project run
> >> properties
> >>> isn't populated with my tomcat installation. There is nothing in the
> list
> >>> to select.
> >>>
> >>> Mark
> >>>
> >>> On Fri, Jan 7, 2022 at 3:48 PM Mark Eggers
>  >>>
> >>> wrote:
> >>>
> >>>> Mark,
> >>>>
> >>>> On 1/7/2022 2:28 PM, Mark Phillips wrote:
> >>>>> I have the latest netbeans on Ubuntu (at least it says it is up to
> >>>> date). I
> >>>>> open an old project, and it says the tomcat server is missing. I
> click
> >> on
> >>>>> Resolve Missing Server, go through the steps to let netbeans know
> where
> >>>> my
> >>>>> tomcat 7 server is located, and click finish. I end up back at the
> same
> >>>>> place - "the target server has not been set or has been removed." If
> I
> >> go
> >>>>> to the Services tab, click on Apache Tomcat, and then start, tomcat
> >>>> starts.
> >>>>> I still can't get the project to associate with Tomcat. I remove the
> >>>> tomcat
> >>>>> instance from Services, restart netbeans, and the same thing happens.
> >> How
> >>>>> do I get out of this endless and unproductive loop?
> >>>>>
> >>>>> Mark
> >>>>>
> >>>>
> >>>> Did you change the project run properties?
> >>>>
> >>>> . . . just my two cents
> >>>> /mde/
> >>>>
> >>>
> >>
> >>
> >
>
>


Re: Can't get project to work with tomcat7

2022-01-09 Thread Mark Phillips
Mark,

My project is old, and is running on tomcat7 in production. It seems mysql
was updated on the production server, and now I cannot add data to
mysql/the application because of this error message:

Generated keys not requested. You need to specify
Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate(),
Statement.executeLargeUpdate() or Connection.prepareStatement().

I need to update the java files for db access, so I need netbeans to work
with this project so I can make a new .war file and update the production
server.

I realize that I am using old stuff, but it works and I don't have time
right now to upgrade the entire site (launched in 2000). I tried running
the site on tomcat 9 when it came out, and there were too many issues to
resolve at that time, so I left it on tomcat7.

I still think there is something screwy with netbeans if it will allow a
tomcat7 server to be added, and run, but won't associate it with a project.

Thanks,

Mark





On Sun, Jan 9, 2022 at 10:39 AM Mark Eggers 
wrote:

> Mark,
>
> What servlet specification is your project? Tomcat 7 (which is EOL BTW)
> will handle up to servlet specification 3.0 (J2EE 6 Web). Anything later
> will require a later version of Tomcat. Tomcat 9 is probably the best
> choice until you're ready to switch to the Jakarta namespace.
>
> . . . just my two cents
> /mde/
>
> On 1/9/2022 7:35 AM, Mark Phillips wrote:
> > Mark,
> >
> > I tried that. The problem is the server list in the project run
> properties
> > isn't populated with my tomcat installation. There is nothing in the list
> > to select.
> >
> > Mark
> >
> > On Fri, Jan 7, 2022 at 3:48 PM Mark Eggers  >
> > wrote:
> >
> >> Mark,
> >>
> >> On 1/7/2022 2:28 PM, Mark Phillips wrote:
> >>> I have the latest netbeans on Ubuntu (at least it says it is up to
> >> date). I
> >>> open an old project, and it says the tomcat server is missing. I click
> on
> >>> Resolve Missing Server, go through the steps to let netbeans know where
> >> my
> >>> tomcat 7 server is located, and click finish. I end up back at the same
> >>> place - "the target server has not been set or has been removed." If I
> go
> >>> to the Services tab, click on Apache Tomcat, and then start, tomcat
> >> starts.
> >>> I still can't get the project to associate with Tomcat. I remove the
> >> tomcat
> >>> instance from Services, restart netbeans, and the same thing happens.
> How
> >>> do I get out of this endless and unproductive loop?
> >>>
> >>> Mark
> >>>
> >>
> >> Did you change the project run properties?
> >>
> >> . . . just my two cents
> >> /mde/
> >>
> >
>
>


Re: Can't get project to work with tomcat7

2022-01-09 Thread Mark Phillips
Mark,

I tried that. The problem is the server list in the project run properties
isn't populated with my tomcat installation. There is nothing in the list
to select.

Mark

On Fri, Jan 7, 2022 at 3:48 PM Mark Eggers 
wrote:

> Mark,
>
> On 1/7/2022 2:28 PM, Mark Phillips wrote:
> > I have the latest netbeans on Ubuntu (at least it says it is up to
> date). I
> > open an old project, and it says the tomcat server is missing. I click on
> > Resolve Missing Server, go through the steps to let netbeans know where
> my
> > tomcat 7 server is located, and click finish. I end up back at the same
> > place - "the target server has not been set or has been removed." If I go
> > to the Services tab, click on Apache Tomcat, and then start, tomcat
> starts.
> > I still can't get the project to associate with Tomcat. I remove the
> tomcat
> > instance from Services, restart netbeans, and the same thing happens. How
> > do I get out of this endless and unproductive loop?
> >
> > Mark
> >
>
> Did you change the project run properties?
>
> . . . just my two cents
> /mde/
>


Can't get project to work with tomcat7

2022-01-07 Thread Mark Phillips
I have the latest netbeans on Ubuntu (at least it says it is up to date). I
open an old project, and it says the tomcat server is missing. I click on
Resolve Missing Server, go through the steps to let netbeans know where my
tomcat 7 server is located, and click finish. I end up back at the same
place - "the target server has not been set or has been removed." If I go
to the Services tab, click on Apache Tomcat, and then start, tomcat starts.
I still can't get the project to associate with Tomcat. I remove the tomcat
instance from Services, restart netbeans, and the same thing happens. How
do I get out of this endless and unproductive loop?

Mark


Issues with Netbeans Project Recognising Tomcat Installation

2019-11-11 Thread Mark Phillips
I am running Apache NetBeans IDE 11.2 with Java: 1.8.0_201 on Debian (Linux
version 5.0.0-32-generic running on amd64). I have a tomcat 7.09 server
installed and running. I can deploy war files from the tomcat manager app
and I can see the tomcat log files in the Netbeans app. However, I cannot
find a way to associate the tomcat server with my Netbeans project. Tomcat
shows up in the list of servers, and I can start and stop it from Netbeans
Services tab.

The project says I am missing a server association, but when I click on
Resolve Missing Server the resulting dialog does not have my tomcat 7
server listed. I have tried removing my tomcat installation from Netbeans
and adding it from the Resolve Missing Server dialog, but I still cannot
deploy directly from Netbeans because, you guessed it, I have a Missing
Server Problem! I have also restarted Netbeans to no avail.

I have fiddled with permissions for the tomcat7 installation to the point
of chmod 755 for the whole directory (this is my development laptop and I
only run instances locally), and that has not helped. Tomcat is installed
in /var/lib/tomcat7. The user and group is tomcat7. Tomcat 7 should work
with JDK 1.8, as it is certified for Java 6 and above.

I also have issues with installing two tomcat servers - still can't deploy
not does the project recognize any of them. I installed tomcat 9 in
/var/lib/tomcat9 with user and group tomcat9.

What I dream of is two tomcat instances, one tomcat 7 and the other tomcat
9, and the ability to deploy from Netbeans to test my project with both
servers. How can I do that, or is that not possible? How do I get at least
one server running so I can deploy from Netbeans?

Thanks!

Mark