Search Results

Search found 960 results on 39 pages for 'annotations'.

Page 10/39 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • iPhone mapView / mapKit using removeAnnotation & addAnnotation results in memory leak?

    - by user266618
    To update the location of a GPS indicator on mapView... [mapView removeAnnotation:myGpsAnnotation]; [myGpsAnnotation release]; myGpsAnnotation = nil; myGpsAnnotation = [[MapLocationAnnotation alloc] initWithCoordinate:region.center annotationType:MapAnnotationTypeGps title:MAP_ANNOTATION_TYPE_GPS]; [mapView addAnnotation:myGpsAnnotation]; ...I see net memory slowly climbing in Instruments (simulator). No "Leak" blip, but "Net Bytes" and "# Net" slowly incrementing... unless this code is commented out. So I'm 100% certain this is the offending code. BUT if I do the following... [mapView removeAnnotation:myGpsAnnotation]; [myGpsAnnotation release]; myGpsAnnotation = nil; myGpsAnnotation = [[MapLocationAnnotation alloc] initWithCoordinate:region.center annotationType:MapAnnotationTypeGps title:MAP_ANNOTATION_TYPE_GPS]; [mapView addAnnotation:myGpsAnnotation]; [mapView removeAnnotation:myGpsAnnotation]; [mapView addAnnotation:myGpsAnnotation]; [mapView removeAnnotation:myGpsAnnotation]; [mapView addAnnotation:myGpsAnnotation]; ...then the "Net Bytes" and "# Net" increase much faster. Is it possible this isn't my mistake, and I'm trying to track down a leak in MapKit? Am I really leaking memory? Again, nothing appears under "Leaks", but then I don't see why Net values would be continually climbing. Thanks for any help, -Gord

    Read the article

  • Spring validation @AssertTrue

    - by Eqbal
    How do I display on a view jsp validation error message that occurs as a result of @AssertTrue annotation? It isn't tied to a specific field, but I am using it to validate a combination of fields. If I use <form:errors path="*"/> that will display all the errors for that form?

    Read the article

  • How do I get spring to inject my EntityManager?

    - by Trampas Kirk
    I'm following the guide here, but when the DAO executes, the EntityManager is null. I've tried a number of fixes I found in the comments on the guide, on various forums, and here (including this), to no avail. No matter what I seem to do the EntityManager remains null. Here are the relevant files, with packages etc changed to protect the innocent. spring-context.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd" xmlns:p="http://www.springframework.org/schema/p"> <context:component-scan base-package="com.group.server"/> <context:annotation-config/> <tx:annotation-driven/> <bean id="propertyPlaceholderConfigurer" class="com.group.DecryptingPropertyPlaceholderConfigurer" p:systemPropertiesModeName="SYSTEM_PROPERTIES_MODE_OVERRIDE"> <property name="locations"> <list> <value>classpath*:spring-*.properties</value> <value>classpath*:${application.environment}.properties</value> </list> </property> </bean> <bean id="orderDao" class="com.package.service.OrderDaoImpl"/> <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="MyServer"/> <property name="loadTimeWeaver"> <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/> </property> <property name="dataSource" ref="dataSource"/> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="showSql" value="${com.group.server.vendoradapter.showsql}"/> <property name="generateDdl" value="${com.group.server.vendoradapter.generateDdl}"/> <property name="database" value="${com.group.server.vendoradapter.database}"/> </bean> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory"/> <property name="dataSource" ref="dataSource"/> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${com.group.server.datasource.driverClassName}"/> <property name="url" value="${com.group.server.datasource.url}"/> <property name="username" value="${com.group.server.datasource.username}"/> <property name="password" value="${com.group.server.datasource.password}"/> </bean> <bean id="executorService" class="java.util.concurrent.Executors" factory-method="newCachedThreadPool"/> </beans> persistence.xml <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> <persistence-unit name="MyServer" transaction-type="RESOURCE_LOCAL"/> </persistence> OrderDaoImpl package com.group.service; import com.group.model.Order; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import java.util.List; @Repository @Transactional public class OrderDaoImpl implements OrderDao { private EntityManager entityManager; @PersistenceContext public void setEntityManager(EntityManager entityManager) { this.entityManager = entityManager; } @Override public Order find(Integer id) { Order order = entityManager.find(Order.class, id); return order; } @Override public List<Order> findAll() { Query query = entityManager.createQuery("select o from Order o"); return query.getResultList(); } @Override public List<Order> findBySymbol(String symbol) { Query query = entityManager.createQuery("select o from Order o where o.symbol = :symbol"); return query.setParameter("symbol", symbol).getResultList(); } }

    Read the article

  • Spring Web MVC: Use same request mapping for request parameter and path variable

    - by ngeek
    Good people: is there a way to express that my Spring Web MVC controller method should be matched either by a request handing in a ID as part of the URI path ... @RequestMapping(method=RequestMethod.GET, value="campaigns/{id}") public String getCampaignDetails(Model model, @PathVariable("id") Long id) { ... or if the client sends in the ID as a HTTP request parameter in the style ... @RequestMapping(method=RequestMethod.GET, value="campaigns") public String getCampaignDetails(Model model, @RequestParam("id") Long id) { This seems to me a quite common real-world URL scheme where I don't want to add duplicate code, but I wasn't able to find an answer yet. Any advice highly welcome.

    Read the article

  • Javassist annoations problem

    - by Ali
    I'm trying to generate my Entity class using javassist. Everything went well until I added the GeneratedValue annotation to the Id field. The @Id annotation works fine but when I add @GeneeratedValue I get an exception. This is my code: ClassPool cp = ClassPool.getDefault(); CtClass ctClass = cp.makeClass("test.Snake"); ClassFile classFile = ctClass.getClassFile(); classFile.setVersionToJava5(); AnnotationsAttribute attribute = new AnnotationsAttribute(classFile.getConstPool(), AnnotationsAttribute.visibleTag); Annotation idAnnotation = new Annotation(classFile.getConstPool(), ClassPool.getDefault().get("javax.persistence.Id")); attribute.addAnnotation(idAnnotation); Annotation gvAnnotation = new Annotation(classFile.getConstPool(), ClassPool.getDefault().get("javax.persistence.GeneratedValue")); attribute.addAnnotation(gvAnnotation); CtField idField = new CtField(ClassPool.getDefault().get("java.lang.Long"), "id", ctClass); idField.getFieldInfo().addAttribute(attribute); ctClass.addField(idField); CtField nameField = new CtField(ClassPool.getDefault().get("java.lang.String"), "name", ctClass); ctClass.addField(nameField); AnnotationsAttribute attr = new AnnotationsAttribute(classFile.getConstPool(), AnnotationsAttribute.visibleTag); Annotation annotation = new Annotation(classFile.getConstPool(), ClassPool.getDefault().get("javax.persistence.Entity")); attr.addAnnotation(annotation); classFile.addAttribute(attr); snakeClass = ctClass.toClass(); newInstance = snakeClass.newInstance(); And this is the exception I get: java.lang.NullPointerException at javassist.bytecode.ConstPool.getUtf8Info(ConstPool.java:565) at javassist.bytecode.annotation.EnumMemberValue.getValue(EnumMemberValue.java:98) at javassist.bytecode.annotation.EnumMemberValue.write(EnumMemberValue.java:116) at javassist.bytecode.annotation.Annotation.write(Annotation.java:316) at javassist.bytecode.AnnotationsAttribute.setAnnotations(AnnotationsAttribute.java:246) at javassist.bytecode.AnnotationsAttribute.addAnnotation(AnnotationsAttribute.java:211) at ClassLoadingTest.javassitTest(ClassLoadingTest.java:56) It seems to be a problem with @GeneratedValue. When I use it alone whithout id I get this exception either. When I use eclipse debugger to watch variable values, I get get this com.sun.jdi.InvocationException occurred invoking method. instead of the annotation value. but for Id annotation it shows a javassist annotation object. I'm new to javassist. Can anyone help me?

    Read the article

  • Spring MVC annotation config problem

    - by Seth
    I'm trying to improve my spring mvc configuration so as to not require a new config file for every servlet I add, but I'm running into problems. I've tried using this tutorial as a starting point, but I'm running into an issue that I can't figure out. The problem is that when I do a GET to my servlet, I get back a 404 error. Here's my config and a representative java snippet from a Controller: web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name>SightLogix Coordination System</display-name> <description>SightLogix Coordination System</description> <servlet> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/application-context.xml /WEB-INF/application-security.xml </param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name> <url-pattern>/slcs/*</url-pattern> </servlet-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/application-context.xml /WEB-INF/application-security.xml </param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> application-context.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-init-method="init" default-destroy-method="destroy"> <mvc:annotation-driven /> <context:component-scan base-package="top.level" /> </beans> application-security.xml: <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> <http> <intercept-url pattern="/**" access="ROLE_MANAGER" requires-channel="https" /> <http-basic /> </http> <authentication-manager> <authentication-provider user-service-ref="myUserDetailsService"> <password-encoder hash="sha"/> </authentication-provider> </authentication-manager> <beans:bean id="myUserDetailsService" class="path.to.my.UserDetailsServiceImpl"> </beans:bean> </beans:beans> Snippet of a Controller class (one of many, but they all look essentially like this): @Controller @RequestMapping("/foo.xml") public class FooController { @RequestMapping(method=RequestMethod.GET) public void handleGET(HttpServletRequest request, HttpServletResponse response) throws IOException { ... Can anyone tell me what I'm doing incorrectly? Thanks!

    Read the article

  • Does the DataAnnotations.DisplayAttribute.Order property not work with ASP.NET MVC 2?

    - by Zack Peterson
    I set values for the Order property of the Display attribute in my model metadata. [MetadataType(typeof(OccasionMetadata))] public partial class Occasion { private class OccasionMetadata { [ScaffoldColumn(false)] public object Id { get; set; } [Required] [DisplayName("Title")] [Display(Order = 0)] public object Designation { get; set; } [Required] [DataType(DataType.MultilineText)] [Display(Order = 3)] public object Summary { get; set; } [Required] [DataType(DataType.DateTime)] [Display(Order = 1)] public object Start { get; set; } [Required] [DataType(DataType.DateTime)] [Display(Order = 2)] public object Finish { get; set; } } } I present my models in strongly-typed views using the DisplayForModel and EditorForModel methods. <%= Html.DisplayForModel() %> and <%= Html.EditorForModel() %> But, ASP.NET MVC 2 displays the fields out of order! What might I have wrong?

    Read the article

  • Annotation to make available generic type

    - by mdma
    Given an generic interface like interface DomainObjectDAO<T> { T newInstance(); add(T t); remove(T t); T findById(int id); // etc... } I'd like to create a subinterface that specifies the type parameter: interface CustomerDAO extends DomainObjectDAO<Customer> { // customer-specific queries - incidental. } The implementation needs to know the actual template parameter type, but of course type erasure means isn't available at runtime. Is there some annotation that I could include to declare the interface type? Something like @GenericParameter(Customer.class) interface CustomerDAO extends DomainObjectDAO<Customer> { } The implementation could then fetch this annotation from the interface and use it as a substitute for runtime generic type access. Some background: This interface is implemented using JDK dynamic proxies as outlined here. The non-generic version of this interface has been working well, but it would be nicer to use generics and not have to create a subinterface for each domain object type. The actual type is needed at runtime to implement the newInstance method, amongst others.

    Read the article

  • How to know when MKPinAnnotationView pin callout opens/closes

    - by JOM
    I want to update pin callout (popup) subtitle either realtime, when I receive some new info from server, or at least when callout opens. So far it looks like pin + callout are created only once at... - (MKAnnotationView *)mapView:(MKMapView *)aMapView viewForAnnotation:(id <MKAnnotation>)annotation ...and then used as-is as long as it exists regardless how many times I tap it closed/open or scroll around keeping it visible. How can I update the subtitle?

    Read the article

  • Get coordinates of google maps markers

    - by App_beginner
    I am creating a databse containing the names and coordinates of all bus stops in my local area. I have all the names stored in my database, and now I need to add the coordinates. I am trying to get these of a website that contains them all as placemarks on a google map. It seems to me like they are being generated from a local server, and then added to the map. However I am unable to find exactly where the server is queried for the coordinates. I am hoping to collect these coordinates through the use of a screen scraper. However unless I am able to find where in the source code the coordinates are created this seems to be impossible. I can of course search and collect all these placemarks manually, but that will be very time consuming. So I am hoping that someone in here can help me. This is the website I am trying to scrape. The placemarks are marked by the blue bus sign: http://reiseplanlegger.skyss.no/scripts/travelmagic/TravelMagicWE.dll/?from=Brimnes+ferjekai+%28Eidfjord%29&to= You can also get the coordinates of a single placemark by writing the name of the stop in the search field and pushing the "Vis i kart" button. I hope someone can help me with this.

    Read the article

  • How to user Hibernate @Valid constraint with Spring 3.x?

    - by Burak Dede
    I am working on simple form to validate fields like this one. public class Contact { @NotNull @Max(64) @Size(max=64) private String name; @NotNull @Email @Size(min=4) private String mail; @NotNull @Size(max=300) private String text; } I provide getter and setters hibernate dependencies on my classpath also.But i still do not get the how to validate simple form there is actually not so much documentation for spring hibernate combination. @RequestMapping(value = "/contact", method = RequestMethod.POST) public String add(@Valid Contact contact, BindingResult result) { .... } Could you explain it or give some tutorial , except original spring 3.x documentation

    Read the article

  • Spring @PostConstruct function in a @Repository called multiple times

    - by Seth
    I have a DAO that I'm trying to inject into a couple different places: @Repository public class FooDAO { @Autowired private HibernateManager sessionFactory; @PostConstruct public void doSomeDatabaseStuff() throws DataAccessException { ... } } And my application-context.xml is a fairly simple context:component-scan: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd" default-init-method="init" default-destroy-method="destroy"> <context:component-scan base-package="top.level"/> </beans> The DAO is accessed from a couple servlets in my application server through @Autowired properties. As far as I understand, anything annotated with @Repository should default to being a singleton and thus doSomeDatabaseStuff() should only be called once (as is my intention). The problem is that I'm seeing doSomeDatabaseStuff() called multiple times. What's going on here? Have I set something up incorrectly? I'm using spring 3.0.0. Thanks for the help.

    Read the article

  • "error: Unexpected error" during maven build with Android Anotations

    - by zasadnyy
    I have problem with building project with android anotations (v.2.6) using maven, with eclipse all works just fine. Here is some project and error details: build configuration snippet from pom: <plugin> <groupId>com.jayway.maven.plugins.android.generation2</groupId> <artifactId>android-maven-plugin</artifactId> <version>3.3.2</version> <inherited>true</inherited> <configuration> <androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile> <assetsDirectory>${project.basedir}/assets</assetsDirectory> <resourceDirectory>${project.basedir}/res</resourceDirectory> <nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory> <sdk> <platform>16</platform> </sdk> <undeployBeforeDeploy>true</undeployBeforeDeploy> </configuration> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.5</version> <inherited>true</inherited> <configuration> <source>1.6</source> <target>1.6</target> </configuration> <extensions>true</extensions> </plugin> and here is output after executing mvn clean install on parent project: [INFO] --- maven-compiler-plugin:2.5:compile (default-compile) @ native-container framework --- [INFO] Compiling 102 source files to /Users/vitaliyzasadnyy/Development/repository/androidcontainer/native-container- android/native-container-framework/target/classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] error: Unexpected error. Please report an issue on AndroidAnnotations, with the following content: java.lang.NullPointerException [ERROR] at com.googlecode.androidannotations.internal.codemodel.JCodeModel.ref(JCodeModel.java:372) at com.googlecode.androidannotations.processing.EBeansHolder.refClass(EBeansHolder.java:160) at com.googlecode.androidannotations.processing.EBeansHolder$Classes.<init>(EBeansHolder.java:50) at com.googlecode.androidannotations.processing.EBeansHolder.<init>(EBeansHolder.java:136) at com.googlecode.androidannotations.processing.ModelProcessor.process(ModelProcessor.java:40) at com.googlecode.androidannotations.AndroidAnnotationProcessor.processAnnotations(AndroidAnnotationProcessor.java:472) at com.googlecode.androidannotations.AndroidAnnotationProcessor.processThrowing(AndroidAnnotationProcessor.java:343) at com.googlecode.androidannotations.AndroidAnnotationProcessor.process(AndroidAnnotationProcessor.java:318) at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:627) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:556) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:701) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:987) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727) at com.sun.tools.javac.main.Main.compile(Main.java:353) at com.sun.tools.javac.main.Main.compile(Main.java:279) at com.sun.tools.javac.main.Main.compile(Main.java:270) at com.sun.tools.javac.Main.compile(Main.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess0(JavacCompiler.java:559) at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:534) at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:168) at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:678) at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) /Users/vitaliyzasadnyy/Development/repository/androidcontainer/native-container-android/native-container-framework/src/main/java/com/nravo/framework/activity/MainScreenActivity.java:[44,-1] Unexpected error. Please report an issue on AndroidAnnotations, with the following content: java.lang.NullPointerException at com.googlecode.androidannotations.internal.codemodel.JCodeModel.ref(JCodeModel.java:372) at com.googlecode.androidannotations.processing.EBeansHolder.refClass(EBeansHolder.java:160) Does anybody faced with this problem?

    Read the article

  • How do i assert my exception message with JUNIT Test annotation ?

    - by Cshah
    i have written a few junits with @Test annotation. If my test method throws a checked exception and if i want to assert the message along with the exception, is there a way to do so with JUNIT @Test annotation.AFAIK, Junit 4.7 doesnt provide this feature but does any future versions provide it. I know in .NET you can assert the message and the exception class. Looking for similar feature in the java world. This is what i want @Test (expected = RuntimeException.class, message = "Employee ID is null") public void shouldThrowRuntimeExceptionWhenEmployeeIDisNull() { }

    Read the article

  • Custom Annotation not showing all

    - by funatsg
    Okay, i have a number of pins on the mapkit. These pins showing different types of attractions. (E.g Parks, Farms and etc) I want to add custom images for these different types of pin. Parks have a park image and vice versa. However, when i added in, not all the images are showing successfully. For example, in parks, it should have 5 pins, but the image only came up in 2 pins, whereas other 3 is in default red pins. But if i used colours to differentiate them. For example, [pinsetPinColor:MKPinAnnotationColorGreen]; It works! Anyone knows what is the problem? Relevant codes below. Tell me if you need more. thanks! - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{ if ([annotation isKindOfClass:MKUserLocation.class]) { //user location view is being requested, //return nil so it uses the default which is a blue dot... return nil; } //NSLog(@"View for Annotation is called"); MKPinAnnotationView *pin=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil]; pin.userInteractionEnabled=TRUE; MapEvent* event = (MapEvent*)annotation; NSLog(@"thetype: %@", event.thetype); if ([event.thetype isEqualToString:@"adv"]) { //[pin setPinColor:MKPinAnnotationColorGreen]; pin.image = [UIImage imageNamed:@"padv.png"]; } else if ([event.thetype isEqualToString:@"muse"]){ //[pin setPinColor:MKPinAnnotationColorPurple]; pin.image = [UIImage imageNamed:@"pmuse.png"]; } else if ([event.thetype isEqualToString:@"nightlife"]){ pin.image = [UIImage imageNamed:@"pnight.png"]; } else if ([event.thetype isEqualToString:@"parks"]){ pin.image = [UIImage imageNamed:@"ppark.png"]; } else if ([event.thetype isEqualToString:@"farms"]){ pin.image = [UIImage imageNamed:@"pfarm.png"]; } else { [pin setPinColor:MKPinAnnotationColorRed]; } pin.canShowCallout = YES; pin.animatesDrop = YES; UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [rightButton addTarget:self action:@selector(clickAnnotation:) forControlEvents:UIControlEventTouchUpInside]; [rightButton setTitle:event.uniqueID forState:UIControlStateNormal]; pin.rightCalloutAccessoryView = rightButton; return pin; }

    Read the article

  • Spring redirecting back to referrer

    - by Eqbal
    I have some resources in my application that require redirection to another resource (form) if some context information is not set. After the context gets set (requires two user steps), I need to redirect back to the requested resource. How do I achieve that. I am using annotation based controllers in Spring 3. Is org.springframework.security.web.savedrequest.HttpSessionRequestCache of any use.

    Read the article

  • Android java.lang.VerifyError for private method with annotated argument.

    - by alex2k8
    I have a very simple project that compiles, but can't be started on Emulator. The problem is with this method: private void bar(@Some String a) {} // java.lang.VerifyError The issue can be avoided if annotation removed private void bar(String a) {} // OK or the method visibility changed: void bar(@Some String a) {} // OK public void bar(@Some String a) {} // OK protected void bar(@Some String a) {} // OK Any idea what is wrong with original method? Is this a dalvik bug, or? If some one whould like to experiment with code, here it is: Test.java: public class Test { private void bar(@Some String a) {} public void foo() { bar(null); } } Some.java: public @interface Some {} MainActivity.java: public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); new Test().foo(); } } Stack trace: ERROR/dalvikvm(1358): Could not find method com.my.Test.bar, referenced from method com.my.Test.foo WARN/dalvikvm(1358): VFY: unable to resolve direct method 11: Lcom/my/Test;.bar (Ljava/lang/String;)V WARN/dalvikvm(1358): VFY: rejecting opcode 0x70 at 0x0001 WARN/dalvikvm(1358): VFY: rejected Lcom/my/Test;.foo ()V WARN/dalvikvm(1358): Verifier rejected class Lcom/my/Test; DEBUG/AndroidRuntime(1358): Shutting down VM WARN/dalvikvm(1358): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) ERROR/AndroidRuntime(1358): Uncaught handler: thread main exiting due to uncaught exception ERROR/AndroidRuntime(1358): java.lang.VerifyError: com.my.Test ERROR/AndroidRuntime(1358): at com.my.MainActivity.onCreate(MainActivity.java:13) ERROR/AndroidRuntime(1358): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) ERROR/AndroidRuntime(1358): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231) ERROR/AndroidRuntime(1358): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284) ERROR/AndroidRuntime(1358): at android.app.ActivityThread.access$1800(ActivityThread.java:112) ERROR/AndroidRuntime(1358): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) ERROR/AndroidRuntime(1358): at android.os.Handler.dispatchMessage(Handler.java:99) ERROR/AndroidRuntime(1358): at android.os.Looper.loop(Looper.java:123) ERROR/AndroidRuntime(1358): at android.app.ActivityThread.main(ActivityThread.java:3948) ERROR/AndroidRuntime(1358): at java.lang.reflect.Method.invokeNative(Native Method) ERROR/AndroidRuntime(1358): at java.lang.reflect.Method.invoke(Method.java:521) ERROR/AndroidRuntime(1358): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) ERROR/AndroidRuntime(1358): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) ERROR/AndroidRuntime(1358): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Does Java Spring 3.0 MVC support annotation/attribute based client side validation like Asp.net MVC

    - by Athens
    In Asp.Net MVC 2.0, at least in the beta, you could decoration your model classes with data annotation attributes and enable client side validation that leverages that criteria defined in your model data annotation attibutes. Is there anything similar for Java Spring MVC 3.0? Is it possible to inject a component into the response pipeline that can inspect the model's annotated properties and render client side validation logic to complement the server side validation logic that is invoked prior to the controller handling the request?

    Read the article

  • How do I install ASP.NET MVC 2 Futures?

    - by Zack Peterson
    I want to use the DataAnnotations.DisplayAttribute.Order property to arrange my fields when using the DisplayForModel and EditorForModel methods. Related question: Does the DataAnnotations.DisplayAttribute.Order property not work with ASP.NET MVC 2? I think that I need to use the ASP.NET MVC 2 Futures. But I can't get it to work. How do I install ASP.NET MVC 2 Futures? Why are my fields still out of order?

    Read the article

  • How do app servers inject into private fields?

    - by cibercitizen1
    I saw this question http://stackoverflow.com/questions/2021716/inject-into-private-package-or-public-field-or-provide-a-setter about how to manually inject into annotated private fields (The way is adding setters or through a constructor) But, the point is how do an application server (like glassfish, axis2, jboss, ...) is able to inject into a final private field (without adding setters or constructors to the user class)? Quoting the cited question: public SomeClass { @Inject private SomeResource resource; } Do they use a customized JVM (not the standard one) that allows to access private fields? Thanks

    Read the article

  • Hibernate mapping - "Could not determine type"

    - by Pool
    I currently have the following objects persisting successfully: Person first name, etc. Exams title, date, etc. I'd like to now create a third table Exam results. For this table I believe it should be person ID, exam ID and result, and this is a many to many relationship. @Entity public class ExamResult { private Exam exam; private Person person; private double value; @Id @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="EXAM_ID") public Exam getExam() { return exam; } public void setExam(Exam exam) { this.exam = exam; } @Id @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="PERSON_ID") public Person getPerson() { return person; } public void setPerson(Person person) { this.person = person; } public double getValue() { return value; } public void setValue(double value) { this.value = value; } } The error: org.hibernate.MappingException: Could not determine type for: Person, at table: ExamResult, for columns: [org.hibernate.mapping.Column(person)] I think I may be going about this the wrong way, but I can't work out how to proceed with this relationship from the tutorial. Any ideas?

    Read the article

  • Link to audio in XHTML/EPUB

    - by wxs
    I'm looking into synchronizing an ebook in epub format (so the content is in XHTML) to an audio file. I'm thinking of putting something along the lines of: <a class="audiolink" href="sound.ogg?t=1093"></a> into the body of the document, and then have a custom epub reader that recognizes those tags and synchronizes the audio accordingly. That does seem like a bit of a hack to me though, especially the use of a special class name. Does anyone have any pointers to how this may be done in a more standards-compliant manner (or somewhere where it has been done before)? Ebooks with audio annotation seem like an idea that may already be out there.

    Read the article

  • JPA optimistic lock - setting @Version to entity class cause query to include VERSION as column

    - by masato-san
    I'm using JPA Toplink Essential, Netbean6.8, GlassFish v3 In my Entity class I added @Version annotation to enable optimistic locking at transaction commit however after I added the annotation, my query started including VERSION as column thus throwing SQL exception. None of this is mentioned in any tutorial I've seen so far. What could be wrong? Snippet public class MasatosanTest2 implements Serializable { private static final long serialVersionUID = 1L; @Id @Basic(optional = false) @Column(name = "id") private Integer id; @Column(name = "username") private String username; @Column(name = "note") private String note; //here adding Version @Version int version; query used: SELECT m FROM MasatosanTest2 m Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException Call: SELECT id, username, note, VERSION FROM MasatosanTest2

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >