Making Glassfish respond to ajax request JSF 2 - jsf-2

I'm trying to do an ajax request to my server (Glassfish v3.1 open source edition) and for any reason the request never go to the server, running the same proyect on tomcat 7 it works correctly, there's any configuration that i should make on glassfich or anything??
im using eclipse helios, jsf 2 MyFaces 2.1.1, richfaces 4.0.0, and glassfish 3.1 open source edition
here's my code
<h:panelGroup>
<h:inputText id="firstName"
value="#{RegistrationForm.first_name}"
required="true"
requiredMessage="Please enter your first name">
<f:converter converterId="bankingCore.UpperCaseConventer for="firstName"/>
<f:ajax event="blur" execute="#all" render="#form"/>
</h:inputText>
<h:message id="NameError" for="firstName" styleClass="errorClass"/>
</h:panelGroup>

Glassfish as being a full Java EE implementation ships with a JSF implementation (Mojarra) already bundled. Glassfish will auto-load it before your webapp. But since you bundled a different JSF implementation (MyFaces) in your webapp, it will collide. Tomcat is a simple JSP/Servlet container and does not ship with JSF bundled so there's also nothing which will collide (until you drop some JSP/Servlet libraries of a different implementation/version in your webapp).
You have 2 options:
Get rid of MyFaces libraries in your webapp. Your webapp will only not run on Tomcat anymore without changing Tomcat's shared classpath to include JSF libraries.
Tell Glassfish to not load its bundled JSF implementation but to use the webapp-bundled JSF instead. Edit the /META-INF/sun-web.xml file in your webapp to contain the following lines:
<class-loader delegate="false" />
<property name="useBundledJsf" value="true" />

Related

.NET 6.0 MVC App returns 404 in IIS on Windows 10

I've just refreshed an app written in .net 2.1 to .net 6.0. I worked through the errors and the site appears to compile cleanly. After I published to the server had many errors. Working through them, and standing up a full IIS install on my own machine, I now have it down to a 404 error.
When running the exe straight from the console it runs without errors.
Z:\ReportGroups>FleetLogix.ReportGroups.exe
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {snip} may be persisted to storage in unencrypted form.
c:\inetpub\wwwroot\ReportGroups>FleetLogix.ReportGroups.exe
Hosting environment: Production
Content root path: c:\inetpub\wwwroot\ReportGroups
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.
Application is shutting down...
Web.config is
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\FleetLogix.ReportGroups.dll" forwardWindowsAuthToken="false" startupTimeLimit="3600" requestTimeout="23:00:00" stdoutLogEnabled="false" hostingModel="inprocess" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
Looking through Event Viewer, there's nothing of note. System nothing for IIS, IIS-Configuration and IIS-Admin are empty.
Edit 2021-11-22
It took a morning, but I have Request Tracing installed. For those on windows 10, just go to Add Features > IIS > Health > Tracing. Don't believe the server 2012 pages. Below is a screenshot:
The actual xml and xslt were quite verbose.
I have reinstalled the Hosting package as administrator, just in case. The version installed was dotnet-hosting-6.0.0-win.exe. That didn't fix it. IIS was stopped/started at server level as well.
At the moment it looks like the handlerv2 is missing?
If any other logs or config are required please let me know
"At the moment it looks like the handlerv2 is missing?" is incorrect.
The correct interpretation of the FRT log is that ASP.NET Core module (handler configured in your web.config) runs fine, and decides that no routing rule yields a result for the incoming URL http://localhost/ReportGroups. Thus, it returns 404 as designed.
It is your responsibility to review IIS configuration (site/app) as well as your source code on routing to see what should be the right URL to use to access the target pages. And unless you share those parts, discussion on this question cannot move forward.

UmbracoAzureBlobStorage - Files lost after some times Using Umbraco 7

I have a project that uses a combination of these tools:
==================================
Azure website
Azure Blob
Azure CDN
UmbracoAzureBlobStorage - 1.0.10.5 - https://github.com/idseefeld/UmbracoAzureBlobStorage
WindowsAzure.Storage - 4.3.0
Umbraco - 7.2.5 assembly: 1.0.5610.18894
idseefeld.de.UmbracoAzure - 1.0.0.0
https://our.umbraco.org/projects/backoffice-extensions/azure-blob-storage-provider/
==================================
config/FileSystemProviders.config
<FileSystemProviders>
<!-- Media -->
<Provider alias="media"
type="idseefeld.de.UmbracoAzure.AzureBlobFileSystem, idseefeld.de.UmbracoAzure">
<Parameters>
<add key="containerName" value="media" />
<add key="rootUrl" value="http://az739977.vo.msecnd.net/" />
<add key="connectionString" value="DefaultEndpointsProtocol=https;AccountName=XXX;AccountKey=XXX" />
</Parameters>
</Provider>
</FileSystemProviders>
==================================
The file upload is working as expected at start. But after sometime, and of course few uploads, it looks like our files are deleted from the blob and the CDN cannot serve them anymore.
Is there something I'm missing? I have almost the same configuration in another project and it's working as expected. I tried reinstalling the whole thing but the problem occurs everytimes.
https://our.umbraco.org/projects/backoffice-extensions/azure-blob-storage-provider/ show us configuration that point directly to the blob, not the CDN as I do. Should I take a look at this?
Uninstall-Pacakge UmbracoAzureBlobStorage
Uninstall-Package idseefeld.de.UmbracoAzure
Install-Package UmbracoAzureBlobStorage
Solved the problems. The project referenced the "idseefeld" DLL. It was kinda weird.

Consuming Web Service using 2 Way SSL using Orbeon client code

We are trying to consume web service from orbeon client code. Everything works fine with one way SSL however we now wish to call the web service using 2 way SSL. We are able to call the web service using 2 way SSL successfully using the Apache CXF framework using Java code.
I followed the steps outlined in the Orbeon Wiki.
Changes made in properties-local.xml
<property as="xs:anyURI"
name="oxf.http.ssl.keystore.uri"
value="/apps/property/ClientStore.jks"/>
<property as="xs:string"
name="oxf.http.ssl.keystore.password"
value="password"/>
<property as="xs:anyURI"
name="oxf.url-rewriting.service.base-uri"
value="http://localhost:8085/Orbeon"/>
<property as="xs:anyURI"
name="oxf.fr.persistence.exist.uri"
value="http://localhost:8085/fr/service/exist"/>
<property as="xs:anyURI"
name="oxf.fr.persistence.exist.exist-uri"
value="http://localhost:8085/exist/rest/db/orbeon/fr"/>
After implementing the changes outlined above we are getting the exception below:
ERROR XFormsServer - xforms-submit-error - setting throwable {throwable:
"javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:390)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:488)
at org.apache.http.conn.scheme.SchemeSocketFactoryAdaptor.connectSocket(SchemeSocketFactoryAdaptor.java:62)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148
Java start up options are:
-Djavax.net.ssl.trustStorePassword=password
-Djavax.net.ssl.keyStore=/apps/property/DMClientStore.jks
-Djavax.net.ssl.keyStorePassword=password
-Djavax.net.ssl.trustStore=/apps/property/trustkeystore.jks
Questions:
Are these properties sufficient for enabling 2 way SSL?
For Apache CXF we need to provide two keystores, one with the client certificate and a truststore. Where do we configure both of these keystores for Orbeon?

error message not in development but rather in deployment using NHibernate version 2.1.1.4000

I have had a look at
Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle'
I am also having the same error message when running the unit tests after deployment, however my application is running fine. Even during development, I am not having any such error.
What is wrong? Why I am having this error message when running the unit test?
The error message is as follows:
NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException : The ProxyFactoryFactory was not configured.
Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers.
Example:
NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu
Example:
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle
]]>
-
-
]]>
Connection string is web.config
> > <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
> <session-factory>
> <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
> <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
> <property name="connection.connection_string">Server=localhost\SQLServer2005;Database=testDev;</property>
> <property name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory,
> NHibernate.ByteCode.Castle</property>
> </session-factory> </hibernate-configuration>
The dll are:
I have NHIbernate version 2.1.1.4000, and I have NHibernate.ByteCode.Castle version 2.1.1.4000 ,Castle.Core 1.1.0, Castle.DynamicProxy2.dll version 2.1.1.0
Which version of NHibernate are you using? Version 3.2 comes pre-configured with a proxy factory. If you are using this version, you no longer need the proxyfactory.factory_class configuration option.
Also, if your tests are failing but not your app, then maybe the tests are not able to access the right hibernate config file. If you are doing the configuration programmatically, look at it once again to verify the proxy factor is set (if using NH < 3.2) or not set (if using NH >= 3.2) ...

how to config JDNI in tomcat7

I just have a test. Config jndi in $CATALINA_HOME/conf/context.xml like below:
<Resource name="jdbc/db" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:#tnsname" username="test" password="test" maxActive="20" maxIdle="10" defaultAutoCommit="false" maxWait="5000" validationQuery="select 1 from dual" testWhileIdle="true" timeBetweenEvictionRunsMillis="5000" removeAbandoned="true" removeAbandonedTimeout="30" logAbandoned="true" />
and I didn't config it in any others places like $CATALINA_HOME/conf/server.xml or /WEB-INF/web.xml or WEB-INF/context.xml. But I still can use it normally in JAVA code.
But from http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html, it seems that at least two files needed to be configed for JNDI.
So could anyone tell me how to config JDNI in tomcat with standard methods. Thanks!
You configured JNDI data source for your application correctly, in the context.xml file for your application. The capability to configure JNDI data sources in the web.xml is preserved in Tomcat 7.0 for compatibility with older versions of Tomcat and, if I'm not mistaken, older versions of Java EE spec.

Resources