"can't find bundle for base name" on JSF messages.properties - maven

I am doing a simple JSF based project (please refer to this image to check out the project structure) but I can't figure out why the faces-config can not reach to the Messages.
Here is the piece of code on the "faces-config.xml" that references the "Messages.properties" file:
<application>
<message-bundle>br.com.teste.primeiraaplicacaojsf.web.i18n.Messages</message-bundle>
<locale-config>
<default-locale>pt_BR</default-locale>
</locale-config>
</application>
Here is the error message generated on the browser:
HTTP Status 500 - Can't find bundle for base name br.com.teste.primeiraaplicacaojsf.web.i18n.Messages, locale pt_BR
type Exception report
message Can't find bundle for base name br.com.teste.primeiraaplicacaojsf.web.i18n.Messages, locale pt_BR
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Can't find bundle for base name br.com.teste.primeiraaplicacaojsf.web.i18n.Messages, locale pt_BR
javax.faces.webapp.FacesServlet.service(FacesServlet.java:671)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
root cause
java.util.MissingResourceException: Can't find bundle for base name br.com.teste.primeiraaplicacaojsf.web.i18n.Messages, locale pt_BR
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
java.util.ResourceBundle.getBundle(ResourceBundle.java:1082)
javax.faces.component.MessageFactory.getMessage(MessageFactory.java:161)
javax.faces.component.MessageFactory.getMessage(MessageFactory.java:251)
javax.faces.component.UIInput.validateValue(UIInput.java:1149)
javax.faces.component.UIInput.validate(UIInput.java:982)
javax.faces.component.UIInput.executeValidate(UIInput.java:1248)
javax.faces.component.UIInput.processValidators(UIInput.java:712)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
javax.faces.component.UIForm.processValidators(UIForm.java:253)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1195)
com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

For some reason IntelliJ project explorer was showing the the path of the "Messages.properties" file as if it was a sequence of folders while behind the curtains it was creating just one folder with the whole path as it's name.
The problem was fixed by remaking the folder structure inside the resources folder (the files remain exactly the same).

Related

Tomcat error - java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper] was found

My Grails 5.2 application fails to start on Heroku with this error:
Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering. Duplicate fragments found in [[jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/tomcat-embed-jasper-9.0.68.jar, jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/webapp-runner-9.0.70.0.jar, jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/tomcat-jasper-9.0.70.jar]].
Here is the error with better formatting:
Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper] was found.
Duplicate fragments found in [
[jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/tomcat-embed-jasper-9.0.68.jar,
jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/webapp-runner-9.0.70.0.jar,
jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/tomcat-jasper-9.0.70.jar]]
I understand the duplication error but don't know how to fix. I am deploying to Heroku.
Below is my Heroku procfile.
web: cd build; java $JAVA_OPTS -Dgrails.env=prod -jar ../build/server/webapp-runner-9.0.70.0.jar --expand-war --port $PORT libs/*.war
I've seen similar issues on SO such as "clearing" tomcat, and adding an entry to web.xml but don't know how to do this using Grails and Heroku.

MapProxy + GeoServer

On our Client's environment we setup a MapProxy+GeoServer for maps needed for their application. During the MapProxy seeding process which calls the Layers on GeoServer, the following exception is thrown :
[2019-12-31 14:23:20,179] mapproxy.source.wms - WARNING - no image returned from source WMS: http://localhost:8080/geoserver/spin/wms?styles=&format=image%2Fpng&height=224&bbox=-24178.5164836,627512.999999,-4570.27472539,629467.0&transparent=True&layers=Grotere_Steden&service=WMS&width=2248&request=GetMap&srs=EPSG%3A28992&version=1.1.1, response was: <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> <ServiceExceptionReport version="1.1.1" > <ServiceException>
java.lang.RuntimeException: java.io.FileNotFoundException: /usr/share/tomcat/webapps/geoserver/data/usr/share/tomcat/webapps/geoserver/data/data/spin/Grotere_Steden.shp (No such file or directory)
java.io.FileNotFoundException: /usr/share/tomcat/webapps/geoserver/data/usr/share/tomcat/webapps/geoserver/data/data/spin/Grotere_Steden.shp (No such file or directory)
/usr/share/tomcat/webapps/geoserver/data/usr/share/tomcat/webapps/geoserver/data/data/spin/Grotere_Steden.shp (No such file or directory)
</ServiceException></ServiceExceptionReport>
The fix needed seems to be on GeoServer side.
The path that needs to be constructed is : "usr/share/tomcat/webapps/geoserver/data/data/spin/Grotere_Steden.shp" (which was the case earlier. )
But on a new installation in a new machine the path generated is : "/usr/share/tomcat/webapps/geoserver/data/usr/share/tomcat/webapps/geoserver/data/data/spin/Grotere_Steden.shp"
I dont understand the change in the construction of the path to the layer file. Please could someone help me with this?

Weblogic deployment error

I have deployed ear files in oracle weblogic server and i also configured datasource for that project. When i try to test it it is giving me this error.
"Message icon - Error weblogic.application.ModuleException: :org.springframework.beans.factory.BeanDefinitionStoreException:Invalid bean definition with name 'userContext' defined in class path resource [voyager-seats-usercontext.xml]: Could not resolve placeholder 'IDM.USERNAME'
Message icon - Warning Errors were encountered while performing this operation."
I restarted and reconfigured this app still it is giving error.

How to configure xuggle for Apache Tomcat in Windows

I have been developing a video sharing web application (like youtube) using Netbeans with Tomcat on Windows platform. There I want to generate thumbnail images of video files as soon as the videos get uploaded. So searching the net I found something called Xuggle. I installed Xuggler in my Tomcat's lib folder. I have set the necessary environment variables. When I run just a java application I get the results, but when I do the same with a Java web application I get the following errors:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from
fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
root cause
java.lang.UnsatisfiedLinkError: com.xuggle.xuggler.XugglerJNI.Global_NO_PTS_get()J
com.xuggle.xuggler.XugglerJNI.Global_NO_PTS_get(Native Method)
com.xuggle.xuggler.Global.<clinit>(Global.java:240)
xugglerPack.Main.<clinit>(Main.java:43)
xugglerPack.VT.processRequest(VT.java:86)
xugglerPack.VT.doPost(VT.java:137)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:3
93)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26
logs.
===========================================================================================
#pd40 >>> I reinstalled Xuggler ( this time in C:\Program Files , I restarted my PC after installation . I set the following in my environment variables :
XUGGLE_HOME = C:\Program Files (x86)\Xuggle
CLASSPATH = .;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\commons-cli.jar;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\logback-classic.jar;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\logback-core.jar;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\slf4j-api.jar;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\xuggle-xuggler.jar;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib\xuggle-xuggler-test.jar;
PATH = C:\Program Files (x86)\Xuggle\bin;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\bin;C:\Apache Tomcat 6.0.26\Apache Tomcat 6.0.26\lib;C:\Program Files (x86)\Xuggle\lib
I have copied the jars of Xuggle/java/jars (6 jar files) in The Tomcat's\lib folder and set the CLASSPATH of them.
Now I still get the problem when i do this in a web application , but standalone java application generates the images nicely. What is going wrong ??? When i upload a video it gets uploaded but the thumbnail images are not generated , I get the following error...
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from
fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: Could not initialize class com.xuggle.ferry.FerryJNI
com.xuggle.ferry.RefCounted.acquire(RefCounted.java:179)
com.xuggle.xuggler.IContainer.copyReference(IContainer.java:80)
com.xuggle.mediatool.AMediaCoderMixin.<init>(AMediaCoderMixin.java:68)
com.xuggle.mediatool.MediaReader.<init>(MediaReader.java:137)
com.xuggle.mediatool.ToolFactory.makeReader(ToolFactory.java:77)
xugglerPack.Main.main(Main.java:51)
xugglerPack.VT.processRequest(VT.java:87)
xugglerPack.VT.doPost(VT.java:135)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26
logs.
Make sure you put Xuggler lib in your windows PATH or LD_LIBRARY_PATH.
Similar to Tomcat native. I assume you have tried this.
You might also want to check out this thread

Error while working with Informatica Design SDK for creating mapping

I have found the mapping sdk code samples, however without any documentation whatsoever.
Currently working with 9.0, I am looking for more info.
For one of the current issues, when I try to save the mapping to repository, (with pcconfig.properties lying in the same folder where the xml file is being generated), I am getting the following error:
Written the file..
Caught an exception in run() method
java.io.IOException: Cannot run program ""C:\Informatica\pmrep"" (in directory "C:\Informatica"): CreateProcess error=2, The system cannot find the file specified
java.io.IOException: Cannot run program ""C:\Informatica\pmrep"" (in directory "C:\Informatica"): CreateProcess error=2, The system cannot find the file specified
com.informatica.powercenter.sdk.mapfwk.exception.MapFwkOutputException: Error saving to repository : Failed to connect to repository
at com.informatica.powercenter.sdk.mapfwk.xml.XMLWriter.save(Unknown Source)
at com.informatica.powercenter.sdk.mapfwk.repository.Repository.save(Unknown Source)
at TestRaghavExample.generateOutput(TestRaghavExample.java:259)
at TestRaghavExample.create(TestRaghavExample.java:64)
at TestRaghavExample.main(TestRaghavExample.java:272)
Caught an exception in run() method
This is my initial example.. trying to find my way through the API..
The path to the pmrep utility doesn't look correct. It is normally found at the path C:\Informatica\<version>\server\bin on Windows.
Check the value of PC_CLIENT_INSTALL_PATH within pcconfig.properties is correct.

Resources