Search Results

Search found 14 results on 1 pages for 'xorty'.

Page 1/1 | 1 

  • Trouble with setting entry point for GWT service

    - by Xorty
    Hello. I've followed serveral tutorials and read official docs at code.google.com, but still didn't manage to resolve this thing. I am creating simple service that'll check if user can be logged. CLIENT SIDE: public interface LoginService extends RemoteService { /** * Checks, if user has valid login. * @param user User's login. * @return True if such a login is in the database. */ boolean isValidUser(User user); } And here is Async interface: public interface LoginServiceAsync { /** * Checks, if user has valid login. * @param user User's login. * @param callback the callback to return True if such a login is in the database. */ void isValidUser(User user, AsyncCallback<Boolean> callback); } SERVER SIDE: public class LoginServiceImpl extends RemoteServiceServlet implements LoginService { /** * serial version UID */ private static final long serialVersionUID = 1044980345057997696L; /**{@inheritDoc} */ @Override public boolean isValidUser(User user) { boolean success = true; //TODO change } } Now I have entry point class MailClient.java. I append here widget like: CustomWidgets.getLoginWidget(this); // access rootPanel and append widget Now I need to make actual call to my service, and here is problem: LoginServiceAsync loginService = (LoginServiceAsync) GWT.create(LoginService.class); User user = new User(boxName.getText(), boxPassword.getText()); AsyncCallback<Boolean> callback = new AsyncCallback<Boolean>() { @Override public void onFailure(Throwable caught) { Window.alert(caught.getMessage()); //TODO change } @Override public void onSuccess(Boolean result) { Window.alert("success"); //TODO change } }; ((ServiceDefTarget) loginService).setServiceEntryPoint(GWT.getModuleBaseURL()+"login"); // dunno what should be here So to recap, I don't know how to set service's entry point. Here's my MailClient.gwt.xml file: <module> <inherits name="com.google.gwt.user.User"/> <inherits name="com.google.gwt.user.theme.standard.Standard"/> <entry-point class="com.xorty.mailclient.client.MailClient"/> <servlet path="/login" class="com.xorty.mailclient.server.servlets.LoginServiceImpl" /> <inherits name="com.xorty.mailclient.MailClient"/> <inherits name="com.xorty.mailclient.MailClient"/> <inherits name="com.xorty.mailclient.MailClient"/> <inherits name="com.xorty.mailclient.MailClient"/> <inherits name="com.xorty.mailclient.MailClient"/> </module> My web.xml file: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <!-- Default page to serve --> <welcome-file-list> <welcome-file>MailClient.html</welcome-file> </welcome-file-list> <servlet> <servlet-name>LoginService</servlet-name> <servlet-class>com.xorty.mailclient.server.servlets.LoginServiceImpl</servlet-class> </servlet> <servlet-mapping> <servlet-name>LoginService</servlet-name> <url-pattern>/com.xorty.mailclient.MailClient/login</url-pattern> </servlet-mapping> </web-app> And here is screenshot of project structure:

    Read the article

  • Hibernate mapping one-to-many problem

    - by Xorty
    Hello, I am not very experienced with Hibernate and I am trying to create one-to-many mapping. Here are relevant tables: And here are my mapping files: <hibernate-mapping package="com.xorty.mailclient.server.domain"> <class name="Attachment" table="Attachment"> <id name="id"> <column name="idAttachment"></column> </id> <property name="filename"> <column name="name"></column> </property> <property name="blob"> <column name="file"></column> <type name="blob"></type> </property> <property name="mailId"> <column name="mail_idmail"></column> </property> </class> </hibernate-mapping> <hibernate-mapping> <class name="com.xorty.mailclient.server.domain.Mail" table="mail"> <id name="id" type="integer" column="idmail"></id> <property name="content"> <column name="body"></column> </property> <property name="ownerAddress"> <column name="account_address"></column> </property> <property name="title"> <column name="head"></column> </property> <set name="receivers" table="mail_has_contact" cascade="all"> <key column="mail_idmail"></key> <many-to-many column="contact_address" class="com.xorty.mailclient.client.domain.Contact"></many-to-many> </set> <list name="attachments" cascade="save-update, delete" inverse="true"> <key column="mail_idmail" not-null="true"/> <index column="fk_Attachment_mail1"></index> <one-to-many class="com.xorty.mailclient.server.domain.Attachment"/> </list> </class> </hibernate-mapping> In plain english, one mail has more attachments. When I try to do CRUD on mail without attachments, everyting works just fine. When I add some attachment to mail, I cannot perform any CRUD operation. I end up with following trace: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133) at domain.DatabaseTest.testPersistMailWithAttachment(DatabaseTest.java:355) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`maildb`.`attachment`, CONSTRAINT `fk_Attachment_mail1` FOREIGN KEY (`mail_idmail`) REFERENCES `mail` (`idmail`) ON DELETE NO ACTION ON UPDATE NO ACTION) at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1666) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1082) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) ... 27 more Thank you

    Read the article

  • Hibernate - strange order of native SQL parameters

    - by Xorty
    Hello, I am trying to use native MySQL's MD5 crypto func, so I defined custom insert in my mapping file. <hibernate-mapping package="tutorial"> <class name="com.xorty.mailclient.client.domain.User" table="user"> <id name="login" type="string" column="login"></id> <property name="password"> <column name="password" /> </property> <sql-insert>INSERT INTO user (login,password) VALUES ( ?, MD5(?) )</sql-insert> </class> </hibernate-mapping> Then I create User (pretty simple POJO with just 2 Strings - login and password) and try to persist it. session.beginTransaction(); // we have no such user in here yet User junitUser = (User) session.load(User.class, "junit_user"); assert (null == junitUser); // insert new user junitUser = new User(); junitUser.setLogin("junit_user"); junitUser.setPassword("junitpass"); session.save(junitUser); session.getTransaction().commit(); What actually happens? User is created, but with reversed parameters order. He has login "junitpass" and "junit_user" is MD5 encrypted and stored as password. What did I wrong? Thanks EDIT: ADDING POJO class package com.xorty.mailclient.client.domain; import java.io.Serializable; /** * POJO class representing user. * @author MisoV * @version 0.1 */ public class User implements Serializable { /** * Generated UID */ private static final long serialVersionUID = -969127095912324468L; private String login; private String password; /** * @return login */ public String getLogin() { return login; } /** * @return password */ public String getPassword() { return password; } /** * @param login the login to set */ public void setLogin(String login) { this.login = login; } /** * @param password the password to set */ public void setPassword(String password) { this.password = password; } /** * @see java.lang.Object#toString() * @return login */ @Override public String toString() { return login; } /** * Creates new User. * @param login User's login. * @param password User's password. */ public User(String login, String password) { setLogin(login); setPassword(password); } /** * Default constructor */ public User() { } /** * @return hashCode * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((null == login) ? 0 : login.hashCode()); result = prime * result + ((null == password) ? 0 : password.hashCode()); return result; } /** * @param obj Compared object * @return True, if objects are same. Else false. * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof User)) { return false; } User other = (User) obj; if (login == null) { if (other.login != null) { return false; } } else if (!login.equals(other.login)) { return false; } if (password == null) { if (other.password != null) { return false; } } else if (!password.equals(other.password)) { return false; } return true; } }

    Read the article

  • What is wiser for me? Eclipse or IntelliJ aka not another IDE war. [closed]

    - by Xorty
    I hope you guys won't take this as attempt of flamewar :) I am quite happy Eclipse user atm, but I am having little dilema: All big companies in my area are using Eclipse, and I quite like Eclipse, but IntelliJ is simply smarter and comfortable in some things. What would you do? If I decide to switch to IDEA I am afraid that I'll regret it someday ... And I don't want to remember like all shortcuts in both eclipse & IDEA, that's simply too much :)

    Read the article

  • Gnome panel hides window titlebar.

    - by Xorty
    I moved my laptop screen "below" external screen (was using left/right config before). There's a little problem. When my gnome panel is on top of laptop screen, all windows I maximize "drawn" under top gnome panel. Therefore, I cannot see window titlebar. I tried suggested fixes as metacity --replace and so on, but none worked. When I move my taskbar to bottom it works just fine. Any ideas? Thank you.

    Read the article

  • Coding with laptop and external screen - neck, back, comfort ...

    - by Xorty
    Guess I'm not the only one here coding on laptop + external keyboard + external screen. I can't really decide. Figure 1: Putting screen directly in front of (upright) my eyes and move laptop to the side. That feels like more comfortable but I can't really see so good to 15" laptop which is now quite away. Feels unused. Figure 2: Putting laptop in front of me and move external monitor on side. Feels like more efficient space usage, but I am afraid that my neck/back might start hurting since I need to turn my head often. What do you prefer? Some good advice? Sacrificing health is definitely no option here so that's why I'm worried and asking this silly question. Thanks

    Read the article

  • NetBeans generates JpaController with errors

    - by Xorty
    Hi, I am using NetBeans 6.8 for building Spring MVC application. Techonologies : Spring MVC 2.5 Derby DB Hibernate for ORM GlassFish v3 server I use New JPA Controller Classes from Entity Classes for adding ORM file. It is supposed to generate class for managing queries with my POJO files. Problem is, that NetBeans generates following code, and won't compile : public int getBrandCount() { EntityManager em = getEntityManager(); try { CriteriaQuery cq = em.getCriteriaBuilder().createQuery(); Root<Brand> rt = cq.from(Brand.class); cq.select(em.getCriteriaBuilder().count(rt)); Query q = em.createQuery(cq); return ((Long) q.getSingleResult()).intValue(); } finally { em.close(); } } At the picture, there is NetBeans error : It looks like method getCriteriaBuilder of Entity Manager Interface is unimplemented. Or some other reason why I can't use it in code. I don't know what other info should I provide, so please ask if anything comes to your mind. Thanks

    Read the article

  • From Java GUI to Java Web

    - by Xorty
    I've been doing quite large application recently with Java - Swing. Now I'd like to move to web. Basically - I am not Microsoft guy, Java is fine with me. I've checked some basics of Java EE framework and decided that my choice will be Spring. I already am familiar with JDBC. Learning Spring is one thing, but working just with GUIs (C++ and Java) means that I have very poor knowledge of web development. Before I start reading tutorials of Spring MVC, what should I know to develop web solutions? I am mainly interested "how to" with graphics ... start from scratch or some nice IDE RAD-like development ? I kind of like f.e. Silverlight and integrating to web or asp.net win forms - allows us 'GUI' people develop faster. So can you please give me some useful advices? Thanx

    Read the article

  • GlassFish can't find persistence provider for EntityManager

    - by Xorty
    Hi, I am building Spring MVC project (2.5). It runs on GlassFish v3 server and I am using Hibernate for ORM mapping from Derby database. I am having trouble with deployment - GlassFish says : No Persistence provider for EntityManager named mvcspringPU. Here is how I create EntityManagerFactory : emf = Persistence.createEntityManagerFactory("mvcspringPU"); And here is my configuration file persistence.xml <?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="mvcspringPU" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>CarsDB</jta-data-source> <properties> <property name="hibernate.hbm2ddl.auto" value="update"/> </properties> </persistence-unit> </persistence> I am building with NetBeans 6.8, so things like build paths should be alright (generated by IDE itself).

    Read the article

  • Eclipse - Handling Java Exceptions like in NetBeans

    - by Xorty
    I recently moved from NetBeans to Eclipse and I very much miss one great feature - whenever I use method which throws some kind of exception, NetBeans alerted me and I needed to add try-catch and NetBeans automatically generated exception type for me. Is there something similiar for Eclipse? f.e. : Integer.parseInt(new String("foo")); NetBeans alerts I need to catch NumberFormatException. Eclipse doesn't alert me at all I am using Eclipse Java EE IDE for Web Developers, 3.5 - Galileo

    Read the article

  • Visual Studio - "{ }" settings

    - by Xorty
    Seriously, I don't know what to google. Here's the thing, I like this java-like code writting: if (condition == true) { doSomeStuff(); } But VisualStudio "helps" me with his own "style", which I don't like and I am unable to change (after rather big time of desperate checking all settings :/) if (condition == true) { DoStuff(); } I obviously want the "{" char to be in same line where condition is ... I am using MS Visual Studio 2010 professional Any help appreciated!

    Read the article

  • ASP.NET MVC - Wrong redirecting, how to debug?

    - by Xorty
    I am stuck with redirecting problem in ASP.NET MVC project. I have mapped tables via LINQtoSQL and each has unique ID as primary key. I am implementing functionallity of 'CREATE'. Basically, after new value is added into SQL table (which means I pressed Save button), I want to be redirected to Details of this freshly added item. Here's little code how I am doing it : [AcceptVerbs(HttpVerbs.Post), Authorize] public ActionResult Create(Item item) { .... return RedirectToAction("Details", new { id = item.ItemID }); Trouble is, I am never redirected to Details view (I have Details.aspx view for items). When I check CallHierarchy in Visual Studio (2010 pro) the hierarchy is indeed little strange, like this : RedirectToAction(string,object) Calls To 'RedirectToAction' Create Calls To Create (no results) Calls From Create (methods of created instance. From there I'll get back to 'RedirectToAction' and to 'Calls to Create' and 'Calls From Create' etc. etc. - loop Edit Calls From 'RedirectToAction' Not supported I am looking for some tools or more specifically 'know how' (since VS probably has some tools) to debug this kind of situations. PS: rooting is default :"{controller}/{action}/{id}", Thanks

    Read the article

  • How can I change GWT's widget CSS values?

    - by Xorty
    Basically, I like default theme widgets. However, I need to change font size on DecoratedStackPanel widget. I think it should be possible with something like this: decoratedStackPanel.getElement().getStyle().setProperty("fontSize", "12pt"); However, "fontSize" is not valid name for property and I didn't find way how to get all element's properties. Therefore, I don't know correct property name. Any ideas? Please, don't post about inheriting widget or writing custom CSS. I like default one but the font size. This should be possible afaik.

    Read the article

1