ATG 10.2 -MessageBrokerServlet is currently unavailable error - atg

I am trying to setup a new ATG site. while accessing the Site Administration-->Site assets
from the ATG bussiness control center, it generating a popup
Unable to connect to the server at http://localhost:8180/FlexUI/messagebroker/amf
While checking the server error logs and cmd, It showing
[[MessageBrokerServlet]] Servlet MessageBrokerServlet is currently unavailable.
Can anyone help me to resolve this issue?

Try deleting your cookies and login again. I sometimes get that error when my session has expired, but the Flex interface is not aware of it.
If the problem persists, take a look at your logs, and see if there were any errors during the BCC startup. If so, post them here so I can try and help you.

Which browser are you running. I am hoping JBOSS, if yes. Go to your BCC server under jboss. And In its deploy folder check for
FlexUI.war > WEB-INF > web.xml
by the end of the file you will find
<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MessageBrokerServlet</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
<load-on-startup>1</load-on-startup>
</servlet-mapping>
Remove <load-on-startup>1</load-on-startup> and restart your BCC. The error should go away.
Hope this helps!

Removing the MessageBrokerServlet load-on-startup works

Related

Entreprise-Application deployed succesfully but it is not running

I am trying to develop my first web-application based on java-EE. This application should be deployed on WildFly application server. For That purpose, I made my inspiration from https://bitbucket.org/lassitercg/example/src.
I made some modifications on my Code.
I am developing this application using IntelliJ-Community. The Application was successfully deployed.
whenever I try to access the application using the following URL localhost:8080/startweb, I get the http status code 404. The code can be found unter this link https://github.com/amitakCsNew/startweb
Since I using Intellij Community edition, I am forced to deploy the application then set the breakpoint in the Controller of the application. The application seems to be succesfully deployed, but I am not jumping to the first breakpoint.
any Idea how I can solve this problem ?
Your webapp layout is wrong. Please refer to the standard Maven directories layout.
You need to move webapp directory to src/main. Then update pom.xml file reference to web.xml, then move META-INF from resources into webapp then fix your syntax errors in index.xhtml (the same h namespace is associated with 2 different URLs), then fix/implement your database, then add faces servlet in web.xml, add faces-config.xml, then your web app should be available at http://localhost:8080/startweb/.
Once you resolve all the problems and the controller code finally executes, you will be able to debug it from the IDE using Remote debug configuration.
If you are new to all of this, I'd suggest starting with something more simple, like a single JSP page and a single Java servlet.
Post the new questions if you have issues describing what you did to solve the problem and what exactly didn't work. The current question is too broad and your sample project has too many issues to cover in the single answer.

Debugging a Maven Web Project in Eclipse(Understanding detailed flow)

I have debugged Java codes as JAVA APPLICATION.(its simple)
Now I am working with Maven project, and I am Keen to know comprehensive flow of this MAVEN+SPRING-JERSEY Project.
I guess debugging could help me with that, I have crawled many sites but cant really get how to debug a Maven Project.
Can anyone help me with this babyish doubt.
Or even you can explain me flow from this example.JERSEY+SPRING+MAVEN
Sorry ! I know This might be silly question,Let me know if I should delete it.
Please let me know if I am Correct:
WHAT I HAVE UNDERSTOOD:
1.Request comes from client,Web.xml Handles this request.
It finds the REST class(with URIs) in given Package.
(Also in meantime,Spring registers all Beans with help of Bean Registry)
2.Then from Service It gets URI , Now request is sent to particular URI.
3.At that URI we have beans,(i.e business logic) which gets executed
4.Then this beans send back result to REST and REST send this response message to client.
This is My understanding from #Michael Hoffman answer.
Please Let me know if this is correct.
Maven is simply providing you with build management. For most cases, it has no impact on how you will debug an application.
Based on your question, the best approach for debugging your application would be to use an IDE like Eclipse. You will need to have Tomcat, or a similar web container, in order to debug at runtime. Otherwise, the flow of code at design time is likely as follows:
At runtime, Spring loads any beans that are to be managed into the Spring container (application context). This may include the controller or service that is executed by the REST-ful call.
Web page or other integration makes a call to the rest service. The address depends on the configuration of the service across the web.xml and Spring application context.
A request flows through the configured servlet. Here is an example of servlet configuration in the web.xml of an app:
<web-app>
<servlet>
<servlet-name>MyApplication</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
...
</init-param>
</servlet>
...
<servlet-mapping>
<servlet-name>MyApplication</servlet-name>
<url-pattern>/myApp/*</url-pattern>
</servlet-mapping>
...
</web-app>
Based on the path requested, the request will flow to an implementing class, often times a controller or service class. The class or methods on the class will have annotation like: #Path("/helloWorld")

Developing with GWT (in eclipse) when NOT using a Java Backend

I want to use a python backend while developing a SmartGWT front end. In order to get the debugging working correctly, I think I need the dev server running in eclipse which means the webserver will be running in eclipse.
My python (Django) backend needs to serve the requests for the data and I'd like it to not be a cross-domain issue, however cross-domain also seems to require the ports match too.
What is the simplest way to work around this? Been thinking about setting up my hosts file with a bogus domain and then have two entries, one for data, one for js. But, this requires setting up a second IP on the machine because the ports have to match too.
If I want anyone else to be able to see the pages I can't use localhost and my external IP since they won't be able to get to my localhost.
Is there some simpler setup?
Is there some simple proxy piece I could drop into the eclipse dev server that would proxy the data requests to a different server?
Other ideas?
I am using a proxy servlet in my gwt setup for this purpose.
I am using a tomcat proxy servlet from jetty util artifact:
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>6.1.22</version>
<scope>runtime</scope>
</dependency>
My web.xml looks like this:
<servlet>
<servlet-name>JettyProxy</servlet-name>
<servlet-class>org.mortbay.servlet.ProxyServlet$Transparent</servlet-class>
<init-param>
<param-name>ProxyTo</param-name>
<param-value>http://yourserver</param-value>
</init-param>
<init-param>
<param-name>Prefix</param-name>
<!-- will be removed from request -->
<param-value>/prefix/</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JettyProxy</servlet-name>
<url-pattern>/prefix/*</url-pattern>
</servlet-mapping>
If you get some weired error about some _context variable, make sure that the jetty-util.jar is in your classpath before the GWT SDK.
Use -noserver for the DevMode. See http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#How_do_I_use_my_own_server_in_development_mode_instead_of_GWT's
The easiest way to do it is if you have both backend and frontend on your development machine.
For my projects I am using GWT on the frontend and cherrypy (python) on the backend.
I set up both projects in eclipse and when developing I start a debugger for the cherrypy backend and one for the GWT frontend. So I can basically debug backend and frontend at the same time. Works really good.
Communication between python backend and gwt frontend is done via RequestBuilder (JSON) and the good thing about this setup is that I can test the backend's data communication directly without GWT.
So the development url is usually something like: http://localhost:8080/?gwt.codesvr=127.0.0.1:9997
Port 8080 is used by my cherrypy backend.

default jetty 7 install, can't access servlets via url

I wrote a small GWT app that includes a websocket servlet. I installed jetty-hightide 7.1.6 on my ubuntu 10.04 server and I cannot access the websocket servlet. However I can access it no problem when running on my local machine for testing. I didn't do any configuration to jetty I simply dropped the war file for the GWT app into the webapps folder and jetty deployed it.
I can access the app itself by going to the expected URL, but I just can't access the servlet via a URL.
the url I use locally is:
ws://127.0.0.1:8888/canvasbattleserver/battleCom
and on the production server:
ws://thelettercliff.com:8080/canvasbattleserver/battleCom
here is the configuration of the servlet in web.xml
<servlet>
<servlet-name>battleServlet</servlet-name>
<servlet-class>com.thelettercliff.project.server.BattleServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>battleServlet</servlet-name>
<url-pattern>/canvasbattleserver/battleCom</url-pattern>
</servlet-mapping>
Any ideas?
See if this works:
Edit this file: /etc/default/jetty
Look for a line that says
JETTY_HOST and change its value to 0.0.0.0
so it should read as:
JETTY_HOST=0.0.0.0
That will make jetty listen to connections on all interfaces.

Deploying JSF application on a Glassfish cluster

When I deploy a JSF application on a Glassfish V2.1 Patch02 Cluster, the following exception is thrown while loading the first page.
java.security.ProviderException: update() failed
at sun.security.pkcs11.P11Cipher.implUpdate(P11Cipher.java:557)
at sun.security.pkcs11.P11Cipher.engineUpdate(P11Cipher.java:457)
at sun.security.pkcs11.P11Cipher.engineDoFinal(P11Cipher.java:485)
at sun.security.pkcs11.P11Cipher.engineDoFinal(P11Cipher.java:471)
at javax.crypto.Cipher.doFinal(DashoA13*..)
...
Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DEVICE_ERROR
at sun.security.pkcs11.wrapper.PKCS11.C_EncryptUpdate(Native Method)
at sun.security.pkcs11.P11Cipher.implUpdate(P11Cipher.java:510)
I am NOT using any kind of encryption/decryption inside my application.
When I googled up for this exception, I found this which is the case when Ciphers are loaded in the application.
I would like to know if Glassfish/JSF load default Ciphers which are causing this exception?
If not, what could be the possible cause and the solution for it?
The issue has been resolved. The problem is this 'minor' bug - https://issues.apache.org/jira/browse/MYFACES-1786
The solution is to put the following entries in the web.xml to disable encryption for state management and to switch the state saving to server
<context-param>
<param-name>org.apache.myfaces.USE_ENCRYPTION</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
From my experience the application when deployed with encryption enabled by 'default' (i.e. having no entry for org.apache.myfaces.USE_ENCRYPTION in web.xml) in Websphere(standalone or cluster) works perfectly okay.
But the application does NOT get deployed in Glassfish cluster or in Tomcat 6 (the problem is defined in the thread - nabble.com/BadPadding-Exception-and-more-td21984713.html)
The only place I can think where the base JSF implementation might use encryption is in state management. The component tree is stateful, so it is preserved between requests, either in the session or in a hidden form field (set by the javax.faces.STATE_SAVING_METHOD init parameter). If a hidden form field is used, the implementation would be wise to encrypt it to prevent hackers rewriting server state. (Note that state management in JSF is pluggable, so 3rd party libraries could replace the default behaviour. If you're using a rich component library, it's worth checking the doc.)
You could try deploying your app in non-clustered glassfish, or in tomcat and see if you get the same situation. Then you would know if the problem is your app or the configuration of the app server or cluster.