Where to download HttpServlet.java v1.2? - servlets

We have a old system that use HttpServlet v1.2, where can I download source for debug in eclipse? I googled obky found v2.0 or v3.0...

The `(version 1.2 : 46.0, ...) indicates that this class file was compiled with java 1.2.
Java 1.2 was specified for both servlet-api 2.2 and 2.3.
As Tomcat has been the reference implementation of these specifications forever, it is possible to rummage through their archive and find (for example) Tomcat 3.3, which was the RI for the 2.2 specification.
A list of distributions can be found at http://archive.apache.org/dist/tomcat/tomcat-3/. If you dig through the binary distributions there you will find a servlet.jar which might match your needs.
If this turns out to be too old (indicated by missing methods in the Java classes it provides) then you will need to search forwards in the Tomcat archives to find the release that implements the Servlet 2.3 specification instead.
(It looks like http://archive.apache.org/dist/tomcat/tomcat-4/ and related contains the Servlet 2.3 spec jars)

Related

Servlet class org.restlet.ext.servlet.ServerServlet is not a jakarta.servlet.Servlet

What could be causing this error?
Caused by: jakarta.servlet.UnavailableException: Servlet class org.restlet.ext.servlet.ServerServlet is not a jakarta.servlet.Servlet
at org.eclipse.jetty.servlet.ServletHolder.checkServletType (ServletHolder.java:499)
at org.eclipse.jetty.servlet.ServletHolder.doStart (ServletHolder.java:377)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:96)
at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$2 (ServletHandler.java:699)
at java.util.stream.SortedOps$SizedRefSortingSink.end (SortedOps.java:357)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining (StreamSpliterators.java:312)
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining (Streams.java:735)
at java.util.stream.ReferencePipeline$Head.forEach (ReferencePipeline.java:658)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
I'm running the web app from mvn jetty:run plugin
jakarta.servlet.UnavailableException: Servlet class [...] is not a jakarta.servlet.Servlet
The jakarta.servlet.Servlet is part of Servlet API version 5.0 which in turn is part of Jakarta EE version 9. This can thus only mean that the servlet class specified in [...] is NOT compiled against Servlet API version 5.0, but against an older version.
You have 2 options:
Upgrade the servlet class specified in [...] to a Servlet API version 5.0 compatible one.
Or, downgrade the servlet container from Servlet API version 5.0 to a previous version, at least the one matching the target Servlet API version of the servlet class specified in [...].
The technical reason is that during the step from Java/Jakarta EE 8 to Jakarta EE 9 all javax.* packages have been renamed to jakarta.* packages. So there is no backwards compatibility anymore since Jakarta EE 9.
When we translate the above facts to your specific situation, your only option is to downgrade the Jetty servlet container to a Servlet 4.0 compatible version. This is because the 3rd party library "Restlet" has currently no Servlet 5.0 compatible version available at all. According to Jetty's version table, Jetty 11.x is Jakarta EE 9 targeted, so you need Jetty version 10.x or older.
Alternatively, you can drop Restlet altogether and use Jersey instead. It has currently a Jakarta EE 9 compatible version available.
See also:
Jetty versions
Getting java.lang.ClassNotFoundException: jakarta.servlet.Filter on Maven/Jersey web service while running on Tomcat 9
I was trying to run a Maven application inside a Wildfly server
I installed 20.0.1.Final, the last version before Jakarta

Symfony 3.0.4 security.secure_random doesn't exists

I'm migrating symfony 2.6 app to the 3.0.4, I'm in a trouble with security.secure_random service, I was using it with dependency injection. Which is representing in security.xml
but I cannot see in 3.0.x I checked changelog every pixel of the project where it does go ? That I'm missing something ?
The class deprecated in 2.8 and removed in 3.0 in favour of the random_bytes function.
Essentialy the SecureRandomInterface had one nextBytes method, which behaves exactly as the PHP7 random_bytes function.
You can install https://github.com/paragonie/random_compat for forward compatibility

Namespace 3.6 in the application descriptor file should be equal or higher than the minimum version 13.0 required by the Flex SDK

I am new to Flash Builder and setup the 4.7 environment according to these instructions: http://www.adobe.com/devnet/air/articles/ane-android-devices.html
The end of the tutorial involves "Export Release Build" of ANESampleTest (a Flex project) and I am getting this error:
"Namespace 3.6 in the application descriptor file should be equal or higher than the minimum version 13.0 required by the Flex SDK"
I do not have a good understanding of Flash/Flex/Air/etc, but following the tutorial to the letter to install Flash Builder, updating the SDK to 3.6, and the partial 'overlay' steps. How do I resolve this error message?
The fix: Change the namespace on the second line of /src/ANESampleTest-app.xml
FROM: <application xmlns="http://ns.adobe.com/air/application/3.6">
TO: <application xmlns="http://ns.adobe.com/air/application/13.0">
A brief and incomplete background:
The file /src/ANESampleTest-app.xml is the ‘application descriptor file’. When using the project files downloaded with the tutorial (that contained the 3.6 reference), the builder did not find this compatible with the configuration on my computer (a trial version I installed today - 5/3/2014 - and patched according to the tutorial). I never did figure out how to lookup valid namespaces and am still confused about how all the sdk’s relate to each other. I stumbled upon this solution by creating a fresh new project and found that the namespace specified by the new project wizard was “13.0” on this line of this file.

Flex4.6 : works in debug but not in Release build

My flex4.6 works normally in debug.
But when I create a release version, I got:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.adobe.serializers.utility::TypeUtility$/getArrayType()
at com.adobe.serializers.json::JSONDecoder/parseObject()
at com.adobe.serializers.json::JSONDecoder/parseValue()
at com.adobe.serializers.json::JSONDecoder/decode()
at com.bravolucy.football.utilities::Utilities$/getAsObj()
looks like:
http://forums.adobe.com/message/4250338
Original project was done in flex4.0 and it uses some swc libraries.
The answer of your question is in your question itself
"Original project was done in flex4.0 and it uses some swc libraries"
before this para it was said
flex4.6 works normally in debug
It should be working fine with 4.6 because with this version playerglobal.version 11.1 being used normally which has JSON lib included with it but prior version to playerglobal - 11 you need to include "as3corelib.swc" in your project libs.
More details you can find at - http://blog.infrared5.com/2011/07/working-with-native-json-in-flash-player-11/
Thanks,
Varun
You need to add and tick as3corelib.swc in project properties.
But even better would be to switch to native JSON.parse

Access to com.sun.crypto.provider in Equinox

I am trying to integrate some pre-existing code that relies on the
com.sun.crypto.provider.SunJCE class into our Equinox based
application (version 3.7.1). Now I know by default the com.sun
packages are not accessible to bundles, so I made a fragment with the
idea of extending the framework to export the package. Here is its
manifest:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Extension
Bundle-SymbolicName: extension
Bundle-Version: 1.0.0.qualifier
Fragment-Host: system.bundle; extension:=framework
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: com.sun.crypto.provider
Clue 1: The PDE marks the Export-Package line and says that
com.sun.crypto.provider does not exist in this plugin.
I created a sample bundle that just instantiates the class in question
in the bundle activator. That bundle's manifest is:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Cryptotest
Bundle-SymbolicName: cryptotest
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: cryptotest.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.sun.crypto.provider,
org.osgi.framework;version="1.3.0"
Clue 2: The PDE marks the instantiation with an access restriction.
Despite the two errors, the project does compile and I am able to
start debugging. When starting the sample bundle, I receive a class
not found exception. However, when I do a "packages 0" in the console, it appears
Equinox is claiming to export this package:
com.sun.crypto.provider;
version="0.0.0"<org.eclipse.osgi_3.7.1.R37x_v20110808-1106 [0]>
cryptotest_1.0.0.qualifier [2] imports
Now, I have found an ugly work around that appears to work in my minimal example. It is to basically wrap Java's jce provider jar in a separate plugin and include that with my application, but that just seems wrong.
Could somebody please provide some insight into what's going on? Is
there something obvious I am missing?
This looks like a package that is present in your JVM, but only when running on a Sun one. These are not exposed by the system bundle by default, because OSGi is not built solely for Sun VMs.
You can, however, instruct the framework to expose this package. To do so, you set the org.osgi.framework.system.packages.extra property to a list of packages, which includes your com.sun.crypto.provider package. There are several ways to do this, but you could, for instance start Equinox with a system property,
-Dorg.osgi.framework.system.packages.extra=com.sun.crypto.provider
By the way, this is not Equinox-specific, but a standard OSGi-construct.

Resources