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 celebration....if 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 everything....pass the bourbon!

Mark

On Sun, Jan 9, 2022 at 3:54 PM Mark Eggers <its_toas...@yahoo.com> 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
>
> <web-app version="2.5" xmlns="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 <m...@phillipsmarketing.biz>
> > Date: Sun, Jan 9, 2022 at 2:58 PM
> > Subject: Re: Can't get project to work with tomcat7
> > To: Mark Eggers <its_toas...@yahoo.com.invalid>
> > Cc: <users@netbeans.apache.org>
> >
> >
> >
> >
> > On Sun, Jan 9, 2022 at 1:27 PM Mark Eggers <its_toas...@yahoo.com.invalid
> >
> > 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 = <web-app version="2.4" xmlns="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 agree....just 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
> >> <its_toas...@yahoo.com.invalid>
> >>> 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
> >> <its_toas...@yahoo.com.invalid
> >>>>>
> >>>>> 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/
> >>>>>>
> >>>>>
> >>>>
> >>>>
> >>>
> >>
> >>
> >
>
>

Reply via email to