Spring security login error - spring

I just implemented a simple login functionality using spring it how ever worked with the eclipse in built browser but gives the following error in chrome and firefox.
HTTP Status 404 - /SpringLogin/welcome.jsp;jsessionid=8332D4F3D4709DCA37C87F30F1EA03D5
The requested resource (/SpringLogin/welcome.jsp;jsessionid=BEE789093FF79CB6B67F8DA368E8B3E4) is not available.
can you please tell me why it is happening?
PS: I have two projects SpringLogin and both of them had same project names and both had similar packages. Then neither of the projects worked properly and gave the above error. How ever after I created another project with a different name and using different package names, it worked like magic. I am guessing here that it may have been the problem. But what is the logical answer that'll explain what happened there?

you don't have being calling the correct URL
it seems that the context /SpringLogin/ does not exists anymore.
Try /welcome.jsp or if you changed the name of application - try /newappname/welcome.jsp

Related

AEM as a Cloud Service + CIF Addon - /api/graphql not working on Publish SDK

One quick question. As of last week I had completely setup the AEM SDK with the Venia store front with all the components working. When I move the setup the AEM publish SDK, I am encountering one issue.
The /api/graphql is throwing 403 errors which means no frontend commerce operation is happening on the storefront.
I tried adding the /api/graphql to the CSRF filter's exclude list and even removed the POST method from there.
After this I still 403 on GET request of /api/graphql and the following on POST request.
I am I missing some setting?
Note: on the sling servlet resolver config, I have added the /api/graphql but there is no change.
There is a query very similar to this on the groups but there is no response. So thought of raising it here.
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-cif-magento-on-publish...
Please let me know if I am missing something.
Issue solved.
I introduced a var called COMMERCE in the global vars to solve the problem, since the vhost file refers to it.
I could have done it slightly better but I guess i was lazy :)
Please refer to this link for details:
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-cif-magento-on-publish/m-p/442185#M31799

Upgrade from spring 3.0.4 to 3.2.2 causes 405 get not supported for stylesheet

If I build my application with spring 3.0.4, the stylesheet is downloaded no problem.
If I build it with 3.2.2.release, however, I get a 405 error saying GET is not supported when it tries to get the stylesheet.
No other changes have been made.
I am deploying to Glassfish
Does anyone have any ideas what could cause this?
Does anyone have any ideas what could cause this?
Potentially many things. (My guess would be that some request is being redirected to the wrong place by SpringSecurity.)
But rather than guessing, you would be better off gathering some concrete evidence of what is happening:
In the web browser, figure out exactly what the pattern of requests and responses is. For instance, if there is a redirect happening, find out what it is redirecting too.
On the server side, enable debug logging for your application, the Spring stack, and if necessary Glassfish. This should provide you with more clues as to what is happening.

GCM: java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender

I have been trying to get Google Cloud Messaging to work in eclipse. I was able to compile the example given on their demo webpage and run that without any errors; however, when I try to create my own example using jersey I get the run time error "java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender" when the following code tries to create a sender.
#POST
#Path("/send")
public Response sendMessage() throws IOException
{
Sender sender = new Sender("api_key");
Message message = new Message.Builder().build();
sender.send(message, DataStore.getDevices(), 5);
return Response.status(200).entity("Success").build();
}
Note: I have replaced my real api key with api_key. I know it works because I was able to get the demo working by running the ant commands explained in the tutorial. Also just to be specific in case of ambiguity, the error I am getting is server side, and has nothing to do with the android device.
Things I have already tried:
I have included the gcm-server.jar in my WEB-INF/lib folder and under project properties I have included it in the build path.
I have also tried, as mentioned on other sites, to include json_simple-1.1.jar the same way I included gcm-server.jar. I don't see how this would effect this error but I saw this listed as an answer in a few different places.
(Solution) Deleted the tomcat server and created a new one. I probably could have just cleaned the project instead and had the same results.
Demo tutorial link: http://developer.android.com/guide/google/gcm/demo.html.
I just found a solution to my problem. In frustration I deleted the old Tomcat server from eclipse and created a new one. When I ran the project again there weren't any problems at all. When I first set up the project I had included the jar files in WEB-INF/lib and later, after reading a lot of posts on the internet, added gcm-server.jar to the build path. It appears that this action would have fixed it but for some reason unknown to me there were some left over files on the server from before the change. I should have tried cleaning my project but I didn't even think about that being the issue. Anyway, I hope that this helps someone because I've sort of condensed all of the information I could find on the internet into this post, as well as included my own dilemma and solution to it.

AppRelativeCurrentExecutionFilePath is always set to ~/ for all ASP.NET Web API paths

Currently, we are adding asp-net web api support to an asp.net application. However when using any path to request an action on the controller, AppRelativeCurrentExecutionFilePath is always set to "~/" and results in 400 error. Used the route debugger available here confirmed that AppRelativeCurrentExecutionFilePath is always incorrect no matter what the url is.
For e.g. all of below url accesses, has AppRelativeCurrentExecutionFilePath as "~/"
http://localhost:1521/Testclient/apitest/values/get
http://localhost:1521/Testclient/apitest/values/get/1
Route debugger also shows failed/no match for above urls even though route table has required entries.
Have disabled all Application_BeginRequest/VPP/module/http handlers and anything that can cause routing to be impacted but still getting into same issue. Any other possible ways this can be debugged?
Update1: Checked the application.Request.AppRelativeCurrentExecutionFilePath by handling Application_BeginRequest( ) in global.asax, even there it appears to be wrong.
Seems to have found the issue, site had a "." in the name and for some reason asp.net does not like it. Root path that caused the issue was
http://localhost:1521/Test.client/apitest/values/get
http://localhost:1521/Test.client/apitest/values/get/1
Note the "Test.Client", changed it to "TestClient" and all worked as expected. When i copied the link from the test machine, had changed it and overlooked it. This should save somebody few hours if they hit this problem. Still not sure if this is a bug!?

500 error when integrating multiple apps in one code base

I'm trying to set up an MVC application that will service several facebook applications for various clients. With help from Prabir's blog post I was able to set this up with v5.2.1 and it is working well, with one exception.
At first, I had only set up two "clients", one called DemoStore and the first client, ClientA. The application determines what client content and facebook settings to use based on the url. example canvasUrl: http://my_domain.com/client_name/
This works for ClientA, but for some reason when I try any DemoStore routes I get a 500 error. The error page points to an issue with the web.config.
Config Error:
Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'facebookredirect.axd'
I am able to add additional clients with no problem, and changing DemoStore to something like "demo" while using the same facebook application settings works fine also.
Working calls:
http:// localhost:2888/ClientA/
http:// localhost:2888/ClientB/
http:// localhost:2888/Demo/
Failing call:
http:// localhost:2888/DemoStore/
I was thinking this might be an MVC issue, but the Config Error points to the facebookredirect handler. Why would the SDK try to add this value to the config during runtime, and only for this specific client?
Any insight would be greatly appreciated.
I managed to figure out what went wrong here. Silly mistake..
After I had set up the application routes to require the client_name I changed the Project Url in the project properties to point to demostore by default. When I hit ctrl+S a dialog popped up that I promptly entered through without reading.
When I changed the Project Url, IIS Express created a new virtual directory for the project. This was the source of my problem. Why? I'm not sure, but once I removed the second site from my applicationhost.config I was able to access the DemoStore routes.
Moral of the story: read the VS dialog messages!

Resources