Glassfish 4 Web Profile - Cannot access remote EJB - jndi

I cannot access remote EJB beans of our application server within a web application running on Glassfish 3 web-profile using jndi lookup.
Using full profile for our web-application or even testing with a console application we have no problem accessing jndi remote beans.
Exception:
Unable to acquire SerialContextProvider for SerialContext
We just hoped to make our web servers more lightweight.

The Web Profile version of Glassfish only contains EJB Lite, which doesn't support #Remote interfaces. You need the Full Profile which supports the full EJB 3 spec.
From the oracle docs:
The Web Profile of the GlassFishTM Server supports the EJB 3.1 Lite
specification, which allows enterprise beans within web applications,
among other features. The full GlassFish Server supports the entire
EJB 3.1 specification. For details, see JSR 318.
You can find a comparision of features included in Web Profile and Full Profile here (It was made for Glassfish 3.1.1 but it should be nearly the same for Glassfish 4 except some newer versions of some features). You can find a nice feature comparision between EJB 3.1 Lite and Full in this article.
Update:
As you wrote in the comment (and the initial question) you are not using any enterprise beans directly in your web application, but you are retrieving bean instances via JNDI. This doesn't work with the Web Profile of Glassfish because the functionality for remote lookups is not there, e.g. the CORBA and ORB modules are missing (there are some basic CORBA OMG APIs but only because they are needed by other modules).
As your goal was to make the server more lightweight, maybe this is another option for you: You can remove unused components and modules with the pkg command-line-tool or with the graphical utility updatetool. You could install the Full Profile of Glassfish and then remove obsolete components step by step to make the server more lightweight. More details about the tools can be found in the oracle docs.
See also:
Can EJB 3.1 Lite be exposed via Remote interface?
How to know what glassfish is - full plaform or web profile?
EE6 web profile … no EJB container?
GLASSFISH-14459 corba classes are part of web profile

Related

Do I need to use the Windows Identity Federation Utility to create a claims-aware asp.net web application?

I built a claims-aware asp.net mvc application following the steps outlined in this page: https://learn.microsoft.com/en-us/dotnet/framework/security/how-to-build-claims-aware-aspnet-mvc-web-app-using-wif. The example in the page uses an STS on the local host, but in my application I am pointing to a fully-functioning AD FS on a different server.
I'm using Framework 4.7 and Windows Server 2016 to host the AD FS and to host the web application.
After I deployed the application I ran the Windows Identity Federation Utility against it (because I thought I needed it to add the application as a Relying Party Trust on the AD FS). This utility inserts a lot of tags into the web.config that refer to the Microsoft.IdentityModel namespace.
I then added the application as a Relying Party Trust to the AD FS, and navigated to the claims-aware app. The page failed because the sample code cast the claim returned by the STS as System.Security.Claims.Claim. When I changed it to cast as Microsoft.IdentityModel.Claims.Claim it worked fine.
The example I was following makes no mention of the Windows Identity Federation Utility. Do I need to use that? Or would this have worked without it?
When I try reversing the web.config changes that the utility inserted the site fails with a 401 error (access denied due to invalid credentials) so obviously the stuff inserted by the Utility is needed to get authentication from AD FS. Is this because I ran the Utility on the web site before adding it as a relying party trust to the ADFS?
The answer here is: don't run the Windows Identity Federation Utility if you are using ADFS Server 2016, as it forces use of the Microsoft.Identity libraries, which are deprecated. I mistakenly thought this utility was needed to create the FederationMetadata.xml file.
I created the FederationMetadata.xml file manually and reverted my web.config back to what it was before I ran the utility. This reverted me back to using the System.Identity libraries, which were added to the 4.5 framework, instead of the now-deprecated Microsoft.Identity libraries.
Just to note that the more "modern way" is to use the OWIN WS-Federation library.
This example is for Azure AD but you simply point to the metadata and the code figures all the rest out for itself.

ADFS 2.0 with ASP.NET MVC 4

I wanted to implement a small Proof of Concept for ADFS integration with MVC application. For this I created a virtual machine for Windows 2008 R2 and configured ADDS, ADCS and added my updated my server domain to one created one using ADDS.
After this I created certificate using ADCS.
Now, installed ADFS 2.0 using Microsoft download of ADFSSetup.exe RTW.
With help of some I configured ADFS & added relying party trust from my MVC application SSL URI.
After this I tried to run the application however started facing 403.14 error page.
Following observations as outcome from entire configuration:
I tried to access "<>/federationmetadata/2007-06/federationmetadata.xml" and I
got a proper XML which is as per expected.
I saw couple of entries from server computer - IIS website as like "http://<>/adfs/services/trust" OR "https://<>/adfs/ls/" however couldn't get any response from server. even I tried to access same from server using localhost instead of server names, then also no luck.
Then to cross-verify I checked IIS's default website where I found adfs/ls however it was a like a website. Not sure correct or not. I couldn't find anything 'services/trust' under ADFS IIS application.
After that I installed ADFS from Server manager and saw one more virtual directory 'fs',added under adfs application. when I tried to access 'fs' using https I am able to access it easily and can see SOAP service and page displayed with available web method.
I tried to find more on 'adfs/ls' and 'adfs/services/trust' however couldn't get much more information.
Please, if anyone came across this issue. Do let me know.
This is not an issue, this is how ADFS works. Next step you have to configure claims providers and relying parties from ADFS management console (from Admin tools). Relying party could be a sample claims aware MVC application. It should work
The only URL's that ADFS "answers" to are the federation metadata endpoint and the IDPInitiated one.
adfs/ls expects either WS-Federation or SAML parameters after it. On its own it will throw an error.
Then follow How To: Build Claims-Aware ASP.NET MVC Web Application Using WIF.
Why are you using Windows 2008 R2? (ADFS 2.0)? You should rather use Windows 2012 R2 (ADFS 3.0).

Support for offline storage in Javafx 2.x

I have an application that shall support offline storage of user data in case the server is unreachable. In Javafx 1.3 that was achieved via the classes javafx.io.Storage and javafx.io.Resource.
When migrating to Javafx 2.0 these classes have been discontinued. I believe that the guys at Oracle have an equivalent functionality for it in Java.
My question is What is the equivalent of the aforementioned classes in Javafx 2.0 What I want is to specify a resource name to which I can store data without worrying where it is exactly stored on the client file system, the same as browsers cookies.
Thanks for your help
Ahmed
There is no equivalent of javafx.io.Storage and javafx.io.Resource in JavaFX 2.x itself. Because JavaFX 2.x is based on Java, you can use Java services.
The JNLP FileSaveService and FileOpenService may be used. These services should work across JNLP based deployments (browser embedded and webstart apps) - not sure if they work for standalone apps.
If you know that your application will be run as a standalone app or a signed browser embedded or webstart app with higher privileges, then you can get the user directory via the user.home system property and write your app data to an an appropriate file location under that, probably using the Files api as in this Files tutorial. For example, use the Files api to create a {$user.dir}/.myapp/appdata.dat file to read and write.
JavaFX embeds an html5 web engine. The WebEngine in JavaFX 8 implements the offline storage portion of the html5 specification, the WebEngine in JavaFX 2.2 does not.

Dwscript web server

I want to use dwscript for web programming ( generating dynamic content). I was wondering if there is any module for apache web server? Or how can I run my own web server based on dwscript?
I'm not (yet?) familiar with DWScript, but I've created an Apache module that runs a Delphi-compiled module that serves a web-site over an abstract interface, so it can plug into IIS or InternetExplorer also. There are also versions that auto-recompile when it detects changes to the source-code, so you can develop and test by hitting refresh in the browser window:
http://xxm.sourceforge.net/

Orchard and Umbraco running on Web Farm Framework 2.0

I am in the process of choosing a CMS system for a few websites we are about to create. We're running a Microsoft environment, so we're only looking at .NET systems, specifically Orchard or Umbraco. We will be running the sites on a cluster running Web Farm Framework 2.0. We have been testing this configuration with Umbraco but have had some issues that essentially have made it impossible for us to run it on WFF. We have not tested this setup with Orchard yet.
Is it possible to run these systems on WFF in your experience, and if so do you have any advice on common pitfalls?
PS. Some more details on our issues with Umbraco on WFF. I won't go into all the various problems we've had, but as an example: We have issues with synching of physical resources between servers and adding data in the database that relies on that synching.
Umbraco can run in a load-balanced environment. I've not dealt with Web Farm Framework myself, and Googling for "umbraco "web farm framework"" yields very little except this question, but the recommended setup for a load-balanced Umbraco site is as per these guidelines over on the Our.Umbraco community wiki.
In our firm we use the SAN/NAS configuration for large websites which avoids file conflicts - two or more IIS instances, one directory on a SAN/NAS share serving up the website itself.
For Web Farm Framework I'm guessing you'll need to run a similar setup to the distributed file system (DFS) configuration for Umbraco. Set up one server behind the load-balancer as the "master" for doing content edits, and let WFF handle the syncing from master to slave/s instead of DFS.
HTH,
Benjamin
This is for Umbraco 4.7x
Use the configuration editor on the webfarm controller server to include the skipDirective for the umbraco temp directory. Umbraco doesn't like the temp directory being synchronized.
<skip name="logFiles" skipDirective="objectName=dirPath,absolutePath=.TEMP.*" />
I'm having a hard time finding the right syntax for absolutePath.
Also edit the /config/umbracoSettings.config file, and include your servers in the following section:
<distributedCall enable="true"> <user>0</user>
<servers>
<server>server1.mywebsite.com</server>
<server>server2.mywebsite.com</server>
<server>server3.mywebsite.com</server>
</servers>
</distributedCall>
Here a link to our.umbraco.org: Installing Umbraco for load balanced environments

Resources