Tuesday, February 28, 2012

subsystem failed. Reason: java.lang.NullPointerException

Was unable to start the managed server due to the following exception.
 I noticed the Perm space was almostfull.

I just killed the java process, restarted the Admin and managed server both and it resolved the issue.
ps -ef | grep java
kill -9 6682
<Feb 28, 2012 5:07:15 PM GMT> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.lang.NullPointerException
java.lang.NullPointerException
        at weblogic.store.io.file.StoreFile.close(StoreFile.java:440)
        at weblogic.store.io.file.Heap.open(Heap.java:320)
        at weblogic.store.io.file.FileStoreIO.open(FileStoreIO.java:104)
        at weblogic.store.internal.PersistentStoreImpl.recoverStoreConnections(PersistentStoreImpl.java:431)
        at weblogic.store.internal.PersistentStoreImpl.open(PersistentStoreImpl.java:422)
        Truncated. see log file for complete stacktrace
>
<Feb 28, 2012 5:07:15 PM GMT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
<Feb 28, 2012 5:07:15 PM GMT> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>
<Feb 28, 2012 5:07:15 PM GMT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN>

 PSYoungGen      total 172032K, used 153481K [0x00000000f4000000, 0x0000000100000000, 0x0000000100000000)
  eden space 147456K, 87% used [0x00000000f4000000,0x00000000fbde26d0,0x00000000fd000000)
  from space 24576K, 100% used [0x00000000fd000000,0x00000000fe800000,0x00000000fe800000)
  to   space 24576K, 0% used [0x00000000fe800000,0x00000000fe800000,0x0000000100000000)
 PSOldGen        total 65536K, used 4288K [0x00000000e0000000, 0x00000000e4000000, 0x00000000f4000000)
  object space 65536K, 6% used [0x00000000e0000000,0x00000000e0430010,0x00000000e4000000)
 PSPermGen       total 118784K, used 118201K [0x00000000d0000000, 0x00000000d7400000, 0x00000000e0000000)
  object space 118784K, 99% used [0x00000000d0000000,0x00000000d736e600,0x00000000d7400000)

Sunday, February 5, 2012

org.hibernate.MappingException: An association from the table TestBeanA refers to

org.hibernate.MappingException: An association from the table TestBeanA refers to
an unmapped class: com.beans.TestBeanB at
org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1285)


Resolution :

I found out that for TestBeanB there was no mapping xml. I created new xml for TestBeanB and added it to context path. This resolves the TestBeanB at the point when it referenced in TestBeanA mapping xml.

TestA xml
























----

Created this mapping xml and added to the context path.

Even though I have man-tomany relationship, I can maintain one-to-many relationship from TestA (one) -> TestB (Many) by not having and reverse mapping in TestB i.e. I dont have any set/list for TestA in Class TestB.












Saturday, January 28, 2012

MYSQL issue : Cannot delete or update a parent row: a foreign key constraint fails

mysql> drop table mgDoctorProfile;
ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
mysql>

Reason : You might have some constraints defined for this table in the child table. Even if you delete the child table, the contraints exists. To resolve the issue execute the following:

mysql> SET FOREIGN_KEY_CHECKS=0;

Then Delete the Parent Table and run the following command again:


mysql> SET FOREIGN_KEY_CHECKS=1;

Wednesday, August 31, 2011

edit hostconfig file on my mac

You can edit it using Terminal. Open terminal, type "cd /etc" (without the quotes), then type "sudo pico hostconfig" (without the quotes).

Make your edits and hit control-x, type "y" when it asks you to save changes, and hit return when it asks for the filename (it'll have "hostconfig" already there as the filename).

Friday, July 15, 2011

[WebContainer : 7] [ERROR] [] [org.apache.wicket.RequestCycle] submitted http post value [radio124] for RadioGroup component [2:form:tabs:panel:crumbPanel:TestRadioGroup] is illegal because it does not contain relative path to a Radio componnet. Due to this the RadioGroup component cannot resolve the selected Radio component pointed to by the illegal value. A possible reason is that componment hierarchy changed between rendering and form submission.

[WebContainer : 7] [ERROR] [] [org.apache.wicket.RequestCycle] submitted http post value [radio124] for RadioGroup component [2:form:tabs:panel:crumbPanel:TestRadioGroup] is illegal because it does not contain relative path to a Radio componnet. Due to this the RadioGroup component cannot resolve the selected Radio component pointed to by the illegal value. A possible reason is that componment hierarchy changed between rendering and form submission.

org.apache.wicket.WicketRuntimeException: submitted http post value [radio124] for RadioGroup component [2:form:tabs:panel:crumbPanel:TestRadioGroup] is illegal because it does not contain relative path to a Radio componnet. Due to this the RadioGroup component cannot resolve the selected Radio component pointed to by the illegal value. A possible reason is that componment hierarchy changed between rendering and form submission.


This issue occurred as My Page had two panels with same component hierarchy. i.e. the child panels was dynamically replaced with each other having a radio group the same wicket id TestRadioGroup.

Sunday, February 20, 2011

Apache Wicket WicketNotSerializableException: Unable to serialize clas

This is a typical Wicket problem which occurs on clicking browser back button and clicking any stale link on the page.

DEBUG - Rendering raw markup
DEBUG - Rendered [Page class = com..web.appointments.page.AppointmentSchedulerPage, id = 3, version = 0]
DEBUG - End render [Page class = com.project.web.appointments.page.AppointmentSchedulerPage, id = 3, version = 0]
DEBUG - ending request for page [Page class = com.project.web.appointments.page.AppointmentSchedulerPage, id = 3, version = 0], request [method = GET, protocol = HTTP/1.1, requestURL = http://localhost:8080/project-1.0/appointmentScheduler, contentType = null, contentLength = -1, contextPath = /project-1.0, pathInfo = null, requestURI = /project-1.0/appointmentScheduler, servletPath = /appointmentScheduler, pathTranslated = null]
DEBUG - ending request for page [Page class = com.project.web.appointments.page.AppointmentSchedulerPage, id = 3, version = 0], request [method = GET, protocol = HTTP/1.1, requestURL = http://localhost:8080/project-1.0/appointmentScheduler, contentType = null, contentLength = -1, contextPath = /project-1.0, pathInfo = null, requestURI = /project-1.0/appointmentScheduler, servletPath = /appointmentScheduler, pathTranslated = null]
ERROR - Error serializing object class com.project.web.appointments.page.AppointmentSchedulerPage [object=[Page class = com.project.web.appointments.page.AppointmentSchedulerPage, id = 3, version = 0]]
org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.project.service.appointments.dataobject.projectAppointment
Field hierarchy is:
3 [class=com.project.web.appointments.page.AppointmentSchedulerPage, path=3]
private java.lang.Object org.apache.wicket.MarkupContainer.children [class=com.project.web.appointments.panel.projectAppointmentSchedulerPanel, path=3:projectAppointmentSchedulerPanel]
private java.lang.Object org.apache.wicket.MarkupContainer.children [class=com.project.web.appointments.form.AppointmentSchedulerForm, path=3:projectAppointmentSchedulerPanel:appointmentSchedulerForm]
java.lang.Object org.apache.wicket.Component.data [class=org.apache.wicket.model.CompoundPropertyModel]
private java.lang.Object org.apache.wicket.model.CompoundPropertyModel.target [class=com.project.service.appointments.dataobject.projectAppointment] <----- data-blogger-escaped-br="" data-blogger-escaped-field="" data-blogger-escaped-is="" data-blogger-escaped-not="" data-blogger-escaped-serializable="" data-blogger-escaped-that=""> at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
at org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.java:684)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:129)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1120)
at org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)
at org.apache.wicket.protocol.http.pagestore.DiskPageStore.storePage(DiskPageStore.java:840)
at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.put(SecondLevelCacheSessionStore.java:332)
at org.apache.wicket.Session.requestDetached(Session.java:1404)
at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1176)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1454)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:468)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:301)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.io.NotSerializableException: com.project.service.appointments.dataobject.projectAppointment
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416)
at org.apache.wicket.Component.writeObject(Component.java:4447)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121)
... 23 more
DEBUG - Getting page [path = 2:projectProfilePanel:AptmntCalendarPanel:sAppointmentList:1:sAppointmentTimeFrameList:4:sAppointmentLink, versionNumber = 0]
DEBUG - setting request target to [BookmarkablePageRequestTarget@-371790702 pageClass=org.apache.wicket.markup.html.pages.PageExpiredErrorPage]
DEBUG - update: Session not dirty.
DEBUG - Redirecting to ?wicket:bookmarkablePage=:org.apache.wicket.markup.html.pages.PageExpiredErrorPage
DEBUG - Add homePageLink to [Page class = org.apache.wicket.markup.html.pages.PageExpiredErrorPage, id = 4, version = 0]
DEBUG - Begin render [Page class = org.apache.wicket.markup.html.pages.PageExpiredErrorPage, id = 4, version = 0]


=========================================
Solution

Override the following method in your page class. It would surely resolve the problem :

/**
* Confgured to clear the cache and re-render the page every time user request for it.
* This is used to overcome the browser back button problem.
*/
@Override
protected void configureResponse() {
super.configureResponse();

final WebResponse response = getWebRequestCycle().getWebResponse();
response.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store");
}

Sunday, January 9, 2011

HTML CSS - Scrollbar to be added to a div

Just came across a requirement where I had to use the scroll bar with a div.

I used the following to put the same:

<div style="overflow:auto;height:200px;width:500px;">
-----
-----
-----
</div>

This works fine and looks cool.