Friday, December 7, 2012

Whats Apache Wicket?

Whats Apache Wicket?

Answer : Apache wicket is a lightweight, component based web application framework.It separates the html or UI completely from Java code, which makes it convenient for designer and programmers to work independently, besides there is no confusing HTML messed up with Java code in it. Its far more convenient than using JSP's where we have to put scriptlets and expressions to use java objects in UI.
Wicket provides many advantages over frameworks like struts and it can be easily integrated with core frameworks like hibernate, spring etc.

java.security.AccessControlException: access denied (java.io.FilePermission

I have a third party service which is being invoked from my J2ee Web application. I have created a remote client class to invoke this service but I am getting  the folllowing exception while trying to access the Remote Client from Weblogic 11 G Server.

<at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)>
  <at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)>
  <at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)>
  <at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)>
  <at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)>
  <at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)>
  <at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)>
<at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)>
 <Warning> <mngd-srvr> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1349369405197> <BEA-2000161> <[Enhance] An exception was thrown while attempting to perform class file transformation on "com.test.services.objects.TestObject":
java.security.AccessControlException: access denied (java.io.FilePermission /srvrs/installed/servers/mngd-srvr/tmp/_WL_user/test-ear/ykrfd6/APP-INF/lib/testdataobjects.jar read)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
        at java.security.AccessController.checkPermission(AccessController.java:546)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
        at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
        at java.io.File.isDirectory(File.java:752)
        at java.io.File.toURL(File.java:623)


Fix: It can be fixed by providing security policy in the Java Options in your setDomainEnv file under bin directory of web logic installation:

I placed a policy file with grant all security level and set its location in the java options.

1. Place grant_all.policy in your config folder:

 grant {
  permission java.security.AllPermission;
};

2.  Add the following in JAVA_OPTIONS in setDomainEnv.

-Djava.security.policy=C:\weblogic\testdomain\config\grant_all.policy





Tuesday, December 4, 2012

The setup requires the .NET Framework version 4.0.

I created a a setup Project for an application I created in .Net framework. But when installing it on a different machine it gave me following Error:

The setup requires the .NET Framework version 4.0. Please install the .NET Framework and run the setup again. The .NET Framework can be obtained  from the web. Would you like to do this now?








http://www.aneef.net/wp-content/uploads/2010/05/5-24-2010-4-00-44-PM.png



I found out that it looks for a specific version of .Net framework if you kept the the default value for Version (in this case 4.0). To resolve this we need to set the version to 'Any' so it run just fine independent of any specific version.

Here is how we configure it.

Under the Setup Project click on the Detected Dependencies.
Click on the Microsoft .Net Framework. Go to Properties window
Change the Version property to 'Any' (Or as per your preference)
Build teh Setup Project again and retry.