Can't get nhibernate config section out though configuration manager - nhibernate

I'm trying to to setup Memcached 2nd level caching. I've followed what documentation I could find, including downloading the project from SVN and looking at how it is configured in their test project, and ended up with this in my app.config.
<configuration>
<configSections>
<section name="memcache" type="NHibernate.Caches.MemCache.MemCacheSectionHandler,NHibernate.Caches.MemCache" />
</configSections>
<memcache>
<memcached host="xx.xx.xx.xx" port="11211" weight="10" />
</memcache>
</configuration>
However, when the MemCache provider code in NHibernate.Caches.MemCache calls configurationmanager.getsection("memcache"), null is returned, which causes it to error out.
I have three projects, .UI, .Core, and .Data - the app.config is for .UI and .Data is where SessionFactory gets built and the code that wants to load this configuration section is launched. .Data has the Nhibernate.Caches.Memcache reference, and I've tried adding it to .UI, however that did not solve the issue.
What is incorrect about this configuration? Or perhaps is it something about my project? Does anyone have any experience at all with NHibernate.Caches.MemCache? There is not much information about it to be found via Google.

The issue ended up being some corruption with my app.config. Everything was right, but it was not being loaded by the assembly. I deleted and re-added it, and then it worked fine.

Related

How to fix, blank screen after deployment of war file

I work still view month on a project with RapidClipse 4.0
I deployed on the production server several versions of the project war files. Everything worked fine.
After the last deployment I got a blank screen after loading the application URL
For the server I use a docker container with following setting:
Apache Tomcat/8.5.43, JVM: 1.8.0_222-b10, 3.10.105, amd64
My first thought was: "ok you did something wrong in your code.. turn back and every thing is fine.... :-((
It wasn't !!
I used several versions which runs fine befor.
I stopped the application, redeployed it and deleted it.
Then I deployed an older version....and once again a version older..a.s.o
Non of the versions which worked fine befor did work again.
I got every time the same result: after loading the application a blank white screen.
So far so bad:
I tried to look into ../conf/server.xml if deployment parameter is set correctly:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
looked fine!
I enhanced the cache by:
$CATALINA_BASE/conf/context.xml added following code:
<Resources cachingAllowed="true" cacheMaxSize="100000" />
also without success.
I tried to look in catalina.out: There is still nothing helpfull:
14-Aug-2019 20:29:21.087 INFO [http-nio-8080-exec-6] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/RC_07.war]
14-Aug-2019 20:29:31.190 INFO [http-nio-8080-exec-6] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/RC_07.war] has finished in [10,102] ms
after debug in browser I got following:
257ms Processing time was 134ms
257msReferenced paintables: 6
283msEstablishing push connection
300msCould not load theme from http://myIP:8888/RC_07/VAADIN/themes//styles.css?v=7.7.13
310msPush connection established using long-polling
I searched also in the history of the docker container an found that this problem (300ms....) still persists from beginning, over all versions I deployed before.
Out of this, I assume, that this could not be the reason, too.
Or am I wrong?
I searched around this VAADIN Problem and found a lot, but I was not able to solve it. The styles.css file are still in place on the server.
I am wondering on ..../VAADIN/themes//styles.css...
the double slash in error message.
But in my code I couldn't find similar.
Also the buildpath in eclipse includes the folder structure like expected.
Now I am at the end!
I am confused, how I should go ahead to figure out the reason for this behavior, or much better to fix it.
Any idea/ help would be welcome!!
Thank you in advance
rgds
OpaHeinz
After long research, togehter with RapidClipse support we found the solution.
I had two issues:
1) unknown how, we assume, that there was an error in the MainUI xml file.
After resetting with and high of view and layout, and turning back to setting before,
the page elements were visible again in design view.
2) there is a parameter for the theme under MainUI properties - misc -
This parameter was set, but without content. This results in a code line: this.setTheme("");
After resetting this, a deployment was possible like before.
Everything is fine now.
Thanks again to RapidClipse support.

log4net log message does not contain method name

I am trying to include the method name %method in log messages when using log4net. However, if I look at the log output it only shows a ? where method name should be.
I know in reading the log4net docs that this is only available with System.Diagnostics.StackTrace and this should only be used in development and not release builds.
Trying to make this work in a .NET Core application using the Microsoft.Extensions.Logging.Log4Net.AspNetCore
and the call to .AddLog4Net(); in Startup
Here is the conversionPattern for the RollingFileAppender
<conversionPattern value="%date %5level %logger.%method [%line] - MESSAGE: %message%newline %exception" />
I have put together a github repository with bare bone example of what I'm trying to get at. If you run the project you see the log file output does not contain method information.
Repository available at log4net-netcore-example
In reviewing various SO articles, I've not found the solution to this yet. I'm assuming I'm missing a configuration or maybe a nuget package required to make this work.
Appreciate any insights anyone can provide.

weblogic hot deployment working for jsps but not for web-inf/classes

I am deploying an ear application in weblogic 10.3 in exploded format with fast swap enabled and in dev mode.
The ear file contains a web app also in exploded format. The changes made to the jsps in the web app are getting reloaded. But the classes under web-inf when changed are not reloaded.
The weblogic deployment configuration is given below.
weblogic-application.xml content in ear/META-INF
<wls:fast-swap>
<wls:enabled>true</wls:enabled>
<wls:refresh-interval>10</wls:refresh-interval>
</wls:fast-swap>
<wls:classloader-structure>
<wls:classloader-structure>
<wls:module-ref>
<wls:module-uri>web.war</wls:module-uri>
</wls:module-ref>
</wls:classloader-structure>
</wls:classloader-structure>
application.xml content in ear/META-INF
<display-name>web-ear</display-name>
<module>
<web>
<web-uri>web.war</web-uri>
<context-root>/web</context-root>
</web>
</module>
<library-directory>lib</library-directory>
weblogic.xml content in war/WEB-INF
<wls:fast-swap>
<wls:enabled>true</wls:enabled>
<wls:refresh-interval>10</wls:refresh-interval>
</wls:fast-swap>
<wls:context-root>/web</wls:context-root>
<wls:session-descriptor>
<wls:cookie-max-age-secs>-1</wls:cookie-max-age-secs>
<wls:cookie-name>JSESSIONID_SQE_AAI</wls:cookie-name>
<wls:cookie-path>/</wls:cookie-path>
<wls:cookies-enabled>true</wls:cookies-enabled>
<wls:invalidation-interval-secs>120</wls:invalidation-interval-secs>
<wls:id-length>52</wls:id-length>
<wls:timeout-secs>7200</wls:timeout-secs>
<wls:url-rewriting-enabled>true</wls:url-rewriting-enabled>
<wls:persistent-store-type>memory</wls:persistent-store-type>
<wls:http-proxy-caching-of-cookies>false</wls:http-proxy-caching-of-cookies>
</wls:session-descriptor>
<wls:jsp-descriptor>
<wls:page-check-seconds>6</wls:page-check-seconds>
</wls:jsp-descriptor>
<wls:container-descriptor>
<wls:servlet-reload-check-secs>6</wls:servlet-reload-check-secs>
<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>
Is the configuration done above right? Are there any config details I have missed to include here? What other settings or configurations should I check?
Any help would be very much appreciated thanks.
Even if you enable FastSwap in your application, the modules that are declared in the classloader-structure will not support FastSwap because they aren't loaded by the RedefiningClassLoader, but rather by the GenericClassLoader.
You can test this by printing the classloader of your classes under WEB-INF/classes and check if it's the com.bea.wls.redef.RedefiningClassLoader or not.
I struggled to make them work together, you can see more details here https://forums.oracle.com/forums/thread.jspa?threadID=2476484&tstart=60 but, unfortunately, no solution so far.
Regards.

Error loading javascript after installing Umbraco 4.7.1

I'm working on an umbraco 4.7.0 project and I have upgrated from 4.7.0 to 4.7.1
It's worked like a charm in my localhost but I have a problem after installing it on the staging server :
When I connect to the backend, I have the javascript error : "Jquery(xx).mask(...) : function does not exist" and any key press execute the umbraco Save function.
The jquery mask plugin is used in umbraco 4.7.1 to add a date mask to the publish date in the property tab.
The Jquery mask plugin is new in Umbraco 4.7.1 and is being included by "DateTimePicker.cs" with [ClientDependency(ClientDependencyType.Javascript, "MaskedInput/jquery.maskedinput-1.3.min.js", "UmbracoClient")]
See : https://hg01.codeplex.com/umbraco/rev/d2304aa897d4
However, even if I delete on the Staging server the bin,umbraco and umbraco-client folders and replace them with the ones from my local computer (where it works) the bug is still here.
But if I change
< compilation defaultLanguage="c#" debug="false" batch="false" targetFramework="4.0">
to
< compilation defaultLanguage="c#" debug="true" batch="false"targetFramework="4.0">
in the web.config THEN it works...
Does someone understand what happened ? How can I make it works with compilation debug=true ??
Thank you very much
Fabrice
As nobody answered this question, I asked on the umbraco forum here :
http://our.umbraco.org/forum/getting-started/installing-umbraco/25196-Error-loading-javascript-after-installing-Umbraco-471
The answer is :
"it's the outdated client dependency cache to blame (when you set debug="true" in your web.config this cache is turned off by design). Try simply to clean the contents of the client dependency cache folder (by default it's App_Data/TEMP/ClientDependency)."

NServiceBus FullDuplex sample compiled and debugging against .NET 4.0 framework throws exception

I just installed VS2010 RC and launched the FullDuplex sample from NServiceBus 2.0.0.1145 and it ran fine. I then changed the target framework of each project in the solution to ".NET Framework 4", recompiled and launched in the debugger and received the following exception:
System.InvalidOperationException was unhandled
Message=No endpoint configuration found in scanned assemblies. This usually happens when NServiceBus fails to load your assembly contaning IConfigureThisEndpoint. Try specifying the type explicitly in the NServiceBus.Host.exe.config using the appsetting key: EndpointConfigurationTypeScanned path: C:\Development\Personal\ThirdParty\NServiceBus\samples\FullDuplex\MyClient\bin\Debug\
Source=NServiceBus.Host
StackTrace:
at NServiceBus.Host.Program.ValidateEndpoints(IEnumerable`1 endpointConfigurationTypes) in d:\BuildAgent-02\work\672d81652eaca4e1\src\host\NServiceBus.Host\Program.cs:line 189
at NServiceBus.Host.Program.GetEndpointConfigurationType() in d:\BuildAgent-02\work\672d81652eaca4e1\src\host\NServiceBus.Host\Program.cs:line 171
at NServiceBus.Host.Program.Main(String[] args) in d:\BuildAgent-02\work\672d81652eaca4e1\src\host\NServiceBus.Host\Program.cs:line 32
InnerException:
You have to provide the correct supported runtime version in the NServiceBus.Host.exe.config
for example:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="EndpointConfigurationTypeScanned" value="d:\w\ServiceBusTest\"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
The error is actually saying everything :)
The generic host cannot find an endpoint configuration, probably because it fails to dynamically discover and load your .NET 4 assemblies.
You might need to check out the NServiceBus source code and built it against .NET 4 yourself for it to work.
I had this problem and found that my "Start external program" path for NServiceBus.Host.exe was not the folder with my assemblies in, thus meaning it couldn't find any endpoints. In this case, two options are to point to NServiceBus.Host.exe in the bin folder or use menty's answer and add an EndpointConfigurationTypeScanned into the config.
I was never able to get this completely resolved. I first had to convert all of the NSB projects to set the target framework to 4.0. I then upgraded to the latest ilmerge and added the necessary arguments for it to the build script. Next I had to update NAnt and NUnit configuration files to also work with 4.0. I was finally able to get a successful build and ilmerge but now I get an error related to the framework version of TopShelf when executing the upgraded FullDuplex sample using the newly compiled libraries.
I'm assuming I'll have to get newer TopShelf binaries or get the source and build it myself against the 4.0 framework but I haven't been able to look at it in the last week.
Andreas, are there any plans to update the NSB project itself to the 4.0 framework in the near future?