Blackboard with Struts - struts

I am a beginner here, and this is my first time creating a building block for Blackboard. I understand that I could use Struts in building block thus I used Struts 1.3 to develop the building block for Blackboard version 9.
I am confuse while doing Dispatch Action, Blackboard doesn't seem to be able to find my forwarded page, and I keep ended up in this error "The specified resource was not found, or you do not have permission to access it".
Link in my jsp:
This is a test
struts-config.xml setup:
<action path="/teststruts" type="com.test.action.TestAction" parameter="execute" scope="request" validate="false">
<forward name="success" path="./thistest.jsp" />
<forward name="error" path="./index.jsp" />
My dispatch action simply mapping.findforward to one of the path.
Really scratching my head here.

Fix the relative path by removing the ./ from the front of your link.
Also verify that your Blackboard Building Block is starting up correctly by looking at the
blackboard/logs/tomcat/sdtout-stderr log after you "disable and enable" the code from the Building Blocks management page. Also verify that your servlet contains a error.jsp as sometimes the 404 error comes from struts forwarding the error on to an error page that does not exist.

Try to use
<permission name="suppressAccessChecks" type="java.lang.reflect.ReflectPermission" />
But i don't think is a good idea to use struts or another framework to develop Blackboard BB. It can generate conflicts with the libraries used by Blackboard, if not with the current version, when updating Blackboard version.
One approach we took when trying to do complex modules in blackboard is to create a full webapp for Blackboard tomcat's instead of a BB. Using this technique it is possible to use whatever you want, since it is an independent application, but at the same time you can comunicate with Tomcat through the context. Yoy have to add the application to the server.xml and add some permissions in catalina.policy to do so... but maybe it could be a little bit tricky...

Related

Nservicebus disable default logger in web.config

I'm using the DefaultFactory LogManager for Nservicebus v5. I'm happy with this but was hoping to be able to disable via the web.config.
I use web.config settings, as found in the help docs
<configSections>
<section name="Logging" type="NServiceBus.Config.Logging, NServiceBus.Core" />
</configSections>
<Logging Threshold="Debug" />
I'd prefer not to set the threshold as fatal. I was hoping for a "None" or Disabled="true"
Also can the directory path be set web.config?
Update: Why would we want to ignore errors?
The short is we don't really have write permission on the servers.
The long is this isn't 100% true.
Our systems is moving towards microservices, the problem with this is that decentralized logging is a tracing/visualization nightmare.
So we moved flow tracing, exceptions, and limited tracing to a centralized system.
Programming Entry points (aka message Handlers, web api endpoints, etc) are nearly always wrapped in a try catch log throw on each handler, this covers all our programming errors. This isn't anything really that different to normal.
The centralized logging location sets of all the nice red flashing real time alarms one could wish for.
Which leaves only configuration type error left like missing queues, bad assembly bindings, faulty config files, or more runtime style stuff like IoC wiring (outside of the handler code).
With the centralized logging and monitoring of the error quests, it is fairly easy to detect when the service is broken and if it is then we turn on logging, restart, try the faulty issue, and fix.
Guaranteed delivery will take care of everything else once it is up again :D Gone are the days of 150mb log files spread across 10 different servers.
The simplicity of DefaultFactory was nice, as was not needing another nuget package and associated configuration.
Is this the correct way forward. Many would argue no.
Could we have done it better? yes we could implement the common logger interface and pass it into NServiceBus but we arn't quiet there just yet and the win isn't critical atm.
A side note: One really really nice thing about the way we log is that in our backoffice tool we have been able to simply show the flow for each "order", similar to using a correlation id in greylog.
Since this was not considered a likely scenario it does not have a first class API. But you can achieve this via passing in a null logger from any of the common logging libraries (NLog, Log4net, CommonLogging). I assume you are using one of these in your website.
So take NLog for example.
Install-Package NServiceBus.NLog
The in your webconfig
<appSettings>
<add key="disableLogging" value="true"/>
</appSettings>
Then in your global startup
if (ConfigurationManager.AppSettings.Get("disableLogging") == "true")
{
LoggingConfiguration config = new LoggingConfiguration();
LogManager.Configuration = config;
NServiceBus.Logging.LogManager.Use<NLogFactory>();
}
This is leveraging the approach documented here http://docs.particular.net/nservicebus/logging-in-nservicebus#nlog

FUSE - Camel visual designer plugin for eclipse clears routes on Saving

I have installed Jboss Integration stack fuse camel editor and created a sample camel route,
<camelContext trace="false" xmlns="http://camel.apache.org/schema/spring">
<route/>
Now when I add and endpoint or any node through source/design view as,
<camelContext trace="false" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri=""/>
</route>
And save with Ctrl+S the routes and nodes are cleared. And empty camel context is left out. Is this a bug or anyway of getting around it?
Please suggest some tips to get around or any other good tools to work with Camel for Visual tooling
Thanks
This is a known issue which is caused by the try to save an invalid route. Please see FUSETOOLS-1085 to follow the issue. The problem is that we consider a route with only an input as invalid atm. Therefore it is not saved. But don't worry, that will be fixed soon. Meanwhile you can work around that by simply always connecting nodes. That means in your case you should just add another node and connect both.
I am sorry for the inconvenience.
Lars

Adding handlers to IIS8

I have IIS8 (complete, not Express) on Win8. I'm trying to make the PUT verb to work on IIS. In fact, my question would be exactly this: ASP.NET Web API - PUT & DELETE Verbs Not Allowed - IIS 8
However, the highest voted answer (provided by the asker himself) doesn't help me because I just don't have the "ExtensionlessUrl-Integrated-4.0" handler. It is simply missing, along with a host of other handlers, that I've have seen in screenshots from similar posts. My only three handlers (that show up on the Handler Mappings dialog of IIS management console at the server level) are: OPTIONSVerbHandler TRACEVerbHandler and StaticFile.
However much I've tried to find a way to add the "ExtensionlessUrl-Integrated-4.0" handler, I've been unable to do it. I tried even to copy into %systemroot%\System32\inetsrv\config\
applicationHost.config the <add> element (within <handlers>) that the author of the referenced post used to solve the problem: <add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />. But to no avail.
I know this is a very noob question (I'm new to IIS), but just have not been able to find an answer in the documentation. May I get a hand, pls?

Where can I find the contents of signalr/hubs

In a typical SignalR view it includes...
<script src="/signalr/hubs"></script>
I'm trying to get my head around SignalR and want to look at the javascript within this folder. But I cant find it within my project.
Also, I understand this contains javascript that is generated customised for my hub class etc. Is this correct?
The /signalr/hubs file is dynamically created by the SignalR server when the app boots up. Since the SignalR server hangs off of the /signalr endpoint it then generates the /hubs ontop of it.
Here's how SignalR 2.0.2 generates the file at a high level: https://github.com/SignalR/SignalR/blob/2.0.2/src/Microsoft.AspNet.SignalR.Core/Hubs/DefaultJavaScriptProxyGenerator.cs .
And here's where it determines that the request is to /signalr/hubs (in 2.0.2) https://github.com/SignalR/SignalR/blob/2.0.2/src/Microsoft.AspNet.SignalR.Core/Hubs/HubDispatcher.cs#L235-L253
Finally to answer your last question, it absolutely does. This is why it's dynamically generated. If you'd ever like to get a physical file that represents the /signalr/hubs endpoint you can follow the instructions here: http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-javascript-client#manualproxy
Hope this helps!
You are correct. It's dynamically generated so that's why you can't see it in visual studio. Enable directory browsing in your web.config by adding
<system.webServer>
<directoryBrowse enabled="true"/>
</system.webServer>
You can then navigate to localhost/signalr/hubs to see the file contents.

Why does HTTP DELETE verb return 405 error - method not allowed for my RESTful WCF service running on IIS 7.5?

Can anyone shed any light on this? I feel like I have wasted the entire day today hunting and searching the internet for any scrap of information about how to do this. I have created a very simple WCF RESTful service. It is basically a proof of concept. I have a simple database behind it and I am just trying to get it working so that I can view, create, update and delete items. Right now I only have view and update working. I'll tackle create later. For now I can't figure out why the delete doesn't work. Almost everything I have found so far tells me that I need to disable the WebDAV module. I did that and then I got PUT to work. But I can not get DELETE to work. Whenever I attempt to call DELETE through my service I get the following error:
The remote server returned an unexpected response: (405) Method Not Allowed.
So it seems like somewhere on my server it is not allowing the DELETE verb. But for the life of me I can not figure it out. I already checked the Handler Mappings and the handler allows all verbs for the .SVC extension. I have disabled WebDAV. I'm not really sure where else to look. I am using IIS 7.5 on Windows Server 2008 R2.
(I can provide code if it would help at all)
Thanks,
Corey
In case anyone having the same issue.
Here is another way you can try.
in web.config
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
</system.webServer>
I just spent a ton of time trying to figure out why I kept getting 405 Method Not Allowed when using the DELETE verb. Everything I read said to uninstall WebDAV from IIS, but that seemed to break IIS in that all sites gave 503 errors. I reinstalled it, then went about looking in IIS for some setting.
It turns out that WebDAV is the problem, and it has a node on the IIS features page named "WebDAV Authoring". Clicking on that lets you then click on WebDAV Settings... to get the properties page. In the section Request Filtering Behavior, set Allow Verb Filtering to False seemed to do the trick for me (YMMV).
This seemed to be a popular result when googling for a solution, so I thought I'd add to the list of suggested solutions.
Open your website's Handler Mappings in IIS Manager
Edit each handler you want to DELETE with, clicking Request Restrictions, choosing the Verbs tab, then add DELETE to the "One of the following" list or, if appropriate within your concerns, allow all verbs.
You might need to restart your website and/or recompile your code
Well I'm not sure if this is really an answer to my question but it did solve the problem. I simply started a new project in Visual Studio and this time I used the .NET REST Service template that I found online. Then I transferred the old code I had from my previous attempt and used it in the new project. It worked like a charm. All four verbs work correctly now (GET, PUT, POST and DELETE). So it is working now.
Corey