Win a copy of Rust Web Development this week in the Other Languages forum!

Tijo Mathew

Greenhorn
+ Follow
since Mar 12, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tijo Mathew

Hi
I am trying to create a folder structure as showed in image to proceed with developing a spring mvc web application. But i failed to create the above structure in eclipse. Appreciate if anyone help me to create the showed structure in eclipse
8 years ago
I have a few JSP pages that are under https, while the rest of the site pages are under http. The login page I have, is under https, and I've noticed that when I login, and redirect to an http page, that the session is not being maintained and again it asks for login.
Anyone could help me to fix this issue?
8 years ago
JSP
again it is giving the same error.
filenamenull
filenamenull
please guide me asap
9 years ago
Hi i am facing problem with config.getInitParameter() which returns null everytime.
i am attaching my servlet code and web.xml
servlet code

String fileName=null;
InputStream in=null;
public void init(ServletConfig config) throws ServletException
{
try
{
fileName = config.getInitParameter("consumer.properties");
System.out.println("filename"+fileName);
in = config.getServletContext().getResourceAsStream(fileName);
System.out.println("filename"+in);
}
catch(Exception e)
{
System.out.println("error from config"+e);
}
}

web.xml
<servlet>
<servlet-name>ProviderServlet</servlet-name>
<servlet-class>all.providers.ProviderServlet</servlet-class>
<init-param>
<param-name>consumer.properties</param-name>
<param-value>E:/workspace/allproviders/WebContent/WEB-INF/lib/consumer.properties</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>ProviderServlet</servlet-name>
<url-pattern>/providers</url-pattern>
</servlet-mapping>

please guide me by rectifying the error.
Thanks in advance
9 years ago
Hi,

I am trying to do an application in JPA with hibernate. But i am getting Repeated column in mapping for entity exception in my code. Please help me to correct if i am wrong in my code.

RegisterBean.java

public class RegisterBean
{
private String userName,password;

private long userID;
private Date dob;
@Embedded
@AttributeOverrides({
@AttributeOverride(name="street",column=@Column(name="home_street")),
@AttributeOverride(name="state",column=@Column(name="home_state")),
@AttributeOverride(name="houseNo",column=@Column(name="home_houseNo"))
})
private AddressClass homeAddressClass;
@Embedded
@AttributeOverrides({
@AttributeOverride(name="street",column=@Column(name="office_street")),
@AttributeOverride(name="state",column=@Column(name="office_state")),
@AttributeOverride(name="houseNo",column=@Column(name="office_houseNo"))
})
private AddressClass officeAddressClass;



@Id
@Column(name="user_id")
@GeneratedValue(strategy=GenerationType.AUTO)

public long getUserID()
{
return userID;
}

public void setUserID(long userID)
{
this.userID = userID;
}
@Temporal(TemporalType.TIMESTAMP)
public Date getDob() {
return dob;
}

public void setDob(Date dob) {
this.dob = dob;
}
@Column(name="user_name")

public String getUserName()
{
return userName;
}

public void setUserName(String userName)
{
this.userName = userName;
}

public String getPassword()
{
return password;
}

public void setPassword(String password)
{
this.password = password;
}

public AddressClass getHomeAddressClass() {
return homeAddressClass;
}

public void setHomeAddressClass(AddressClass homeAddressClass) {
this.homeAddressClass = homeAddressClass;
}

public AddressClass getOfficeAddressClass() {
return officeAddressClass;
}

public void setOfficeAddressClass(AddressClass officeAddressClass) {
this.officeAddressClass = officeAddressClass;
}

}

AddressClass.java

@Embeddable
public class AddressClass
{
@Column(name="office_street")
private String street;
@Column(name="office_state")
private String state;
@Column(name="office_houseNo")
private Long houseNo;

public String getStreet()
{
return street;
}
public void setStreet(String street)
{
this.street = street;
}

public String getState()
{
return state;
}
public void setState(String state)
{
this.state = state;
}

public Long getHouseNo()
{
return houseNo;
}
public void setHouseNo(Long houseNo)
{
this.houseNo = houseNo;
}

hibernate.cfg.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>


<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/shop</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1000</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- Enable Hibernate's automatic session context management -->
<!-- <property name="current_session_context_class">thread</property> -->

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">create</property>
<mapping class="com.all.RegisterBean" />

</session-factory>
</hibernate-configuration>

mainClass.java

public class HibernateCall
{
public static void main(String[] args)
{
RegisterBean registerBean=new RegisterBean();
AddressClass homeAddressClass=new AddressClass();
AddressClass officeAddressClass=new AddressClass();

registerBean.setUserName("t");
registerBean.setPassword("ti");
registerBean.setDob(new Date());
homeAddressClass.setStreet("tho");
homeAddressClass.setState("ke");
homeAddressClass.setHouseNo(13L);
registerBean.setHomeAddressClass(homeAddressClass);
officeAddressClass.setStreet("kot");
officeAddressClass.setState("k");
officeAddressClass.setHouseNo(14L);
registerBean.setOfficeAddressClass(officeAddressClass);
SessionFactory sessionFactory=new Configuration().configure().buildSessionFactory();
Session session=sessionFactory.openSession();
session.beginTransaction();
session.save(registerBean);
session.getTransaction().commit();
session.close();


}

error is

Exception in thread "main" org.hibernate.MappingException: Repeated column in mapping for entity: com.kjc.all.RegisterBean column: houseNo (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:681)
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:703)
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:699)
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:725)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:478)
at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1294)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1736)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1782)
at com.all.MainClass.main(MainClass.java:28)

i checked with insertable=false and updatable=false. even it is not worked for me.

any help will be appreciatable. Thanks in advance
Hi

I am able to track the IP address of remote machine. I want to know that whether can we able to track the MAC address of remote machine in web application? Please help me. Thanks in advance.
9 years ago
Thanks a lot Rakesh.............It has worked....Appreciate your guidance....
9 years ago
Thanks for your reply. I could not do the installation...
9 years ago
Hi Tim Holloway,

I did what you said for tomcat plugin downloaded. I am new to sysdeo tomcat plugin. could you provide me how to integrate this in eclipse by step wise procedure?

thanks in advance.
9 years ago
Hi all,

I am trying to integrate tomcat 7 in eclipse indigo. I downloaded tomcat 7 plugin and copied in to eclipse plugin folder. I am getting tomcat start, stop and restart icon in tomcat tool bar. But when i click on start tomcat icon it says "tomcat settings should be configured in a tomcat preference". Could anyone help me to start the tomcat server in eclipse indigo by giving the step by step procedure. Thanks in advance...
9 years ago
actually it was date mismatching with MYSQL date data type. I got through using the db.printStackTrace() in my code. Thanks for help.
thanks...i rectified the error....
Hi

I am using the following code in struts. When i call this method from an action class, it prints null value. It not inserting values in to database. Any help is appreciable.



Thanks in advance
Hi,

I want to run multiple web sites using apache web server and tomcat instance. When i type my web site name in web browser, apache web server has to determine which site should be loaded. Please help me by giving step by step procedure to do so. Hope i am clear with my requirement.

Thanks in advance
9 years ago
In my application, at the User registration time, i want to Encrypt the password field and then i like to store into the database.

After that the same user will be sign in, at the moment the database password will decrypt and it will be compare with password which user enters in the field.

If both passwords are equal, then only the user will allow the sign in.

can anyone help me with working sample code for encryption and decryption process.

Thanks in advance.
9 years ago