Mahesh Panchananam

Greenhorn
+ Follow
since Jun 30, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mahesh Panchananam

Yes. it fails because ANT does not have the jars in classpath, for that you need to define a PATH entry and give the reference while compiling JAVA classes.

Define path in build.xml
<path id="someId">
<fileset dir="path of your lib folder">
<include name="*.jar"/> //to include all the files having .jar extension
</fileset>
</path>

Use this path while compiling

<javac srcdir="the src directory" destdir="destination where you want the .class files" classpathref="someId"/> //the Id of the path defined above

Rgds
Mahesh PS
9 years ago
Java Archive Conflict


javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=57;_ThreadName=Thread-1;|Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'guestController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private guest.GuestDao guest.GuestController.guestDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'guestDao': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/context/applicationContext-persistence.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:130)
at org.glassfish.internal.data.EngineRef.start(EngineRef



If you observe the last few lines, the EntityManagerFactory is not getting initialized properly. This can be resolved if you add proper java archives files.


Rgds
Mahesh PS
Envt issue, delete all the pre-built jars & classes folders then run ant task. Even I faced the same issue sometimes.

Rgds
Mahesh PS
It's not whether the session is closed or opened, It's JPAs way to handle duplicates.
This exception is thrown when you try to persist a duplicate entity.

try {
entityManager.create(Obj) ;
}
catch(EEE e) {
}


Rgds
Mahesh PS
The simple way I can suggest is define properties in the POJO properly and convert the text to upper case for the UI purpose.
I am not sure whether there is any way to get the names of columns, even if there is a way, dont apply that unnecessarily.

Rgds
Mahesh PS
This is the problem with the Compiler & JDK version being used.

Eclipse -> windows -> preferences -> Java -> compiler

Rgds
Mahesh PS
Well, the best reference I can suggest is
http://download.oracle.com/javase/6/docs/api/

what is the best way for new Java programmers to find the classes that would be most useful for their projects?



Everything is useful, but you need to know how efficiently you can use the features.
With good experience you will come to develop good programming skills.

Rgds
Mahesh PS
9 years ago
Well, it's very simple & currently in many projects this approach is being followed.

what is to be done

Lets say we have 2 projs named proj1 & proj2 and proj2 is depending on proj1, As proj1 is the base proj, it needs to be built first and then need to converted to a jar file (proj1.jar) and which has to be included in the build path of proj2.

How to achieve

This can be achieved with build tools e.g ant, maven etc..

My suggestion is to start with ant tool because you will not require any repository for this.

Refer apache -ant web site for ant tasks and samples.

Rgds
Mahesh PS





9 years ago
Good Question..

When you observe the evolution of technologies, it will be like servlet -> JSP -> MVCs etc, Now MVCs are ruling the world because of the features provided by them.

Use JSF plain for basic mvc flow and richfaces for rich look of the application.

Solution for your scenario.

Define a form in the jsp (list of names /menu list) & bind it to the bean in web-layer then it's your time to play with the features of JSF.
you can get many samples on internet for this.

Rgds
Mahesh PS
9 years ago
Hi James, Hearty welcome...
9 years ago
Hi Rob, Generally there will be thick clients when a swing application is created. It must be independent of web technologies, all the stuff that you to achieve with javascript can be achived with the well defined java components.

There are ways to do some work around for this but make use of the well defined java packges.

Rgds
Mahesh PS
9 years ago
Yes..! I agree with the Dieter's approach to get the map from the HTML page.

My suggestion is : use pagination or smart fetch, instead of displaying or editing all the rows.

1. Limit the number of rows in each page to 10 or 15.
2. Do not try to manage list of too many records in javascript, if so the browser will get hung & throws "Script Error"

Rgds
Mahesh PS
9 years ago
JSP
Please mention the techology you are using

e.g: struts/spring/jsf or simple sevlet programming so that I can help you better.

Rgds
Mahesh PS
9 years ago
JSP
Hi Reddy

I suggest not to do it instead write a custom tag and use it.
you can browse to get many details on it.

Rgds
Mahesh
9 years ago
JSF
This often occurs in JSF implementation.
Steps:
- Define the controller required in web.xml
<servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
- make sure you have defined all the objects (beans) that are being used to manage.
- I ll attach a sample asap.

Rgds
Mahesh PS
9 years ago
JSF