{"id":5668,"date":"2014-04-04T18:47:09","date_gmt":"2014-04-04T18:47:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/04\/javaspringannotationsspring-dataspring-data-jparelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-04-04T18:47:09","modified_gmt":"2014-04-04T18:47:09","slug":"javaspringannotationsspring-dataspring-data-jparelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/04\/javaspringannotationsspring-dataspring-data-jparelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"java,spring,annotations,spring-data,spring-data-jpaRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/QfNNc.jpg?s=32&amp;g=1\" \/><br \/>\nPhoenixLament<br \/>\njava android android-camera<br \/>\nI am interested in writing an app for android where after a certain event in the app a photo is automatically taken using the camera on the android. Things I need:No Preview of photo No Button for User to press to take the photo Just run the operation to take a photo and store it to the album.here is some code i tried from a tutorial online:public void snap(){mCamera = Camera.open();SurfaceView sv = new SurfaceView(getApplicationContext());try {mCamera.setPreviewDisplay(sv.getHolder());parameter<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/95ef58bce1725fbe91dae9757e57465d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbclarance<br \/>\njava maven plugins surefire<br \/>\nI need to use surefire v2.12, but I get the attached stack trace every time I run that version. If I run v2.10 I do not get the error. I need this version so I can annotate my test classes with @Category and label them as either UnitTests or IntegrationTests. Here&#8217;s my command: mvn test -Dsurefire.version=2.12 -X[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project PROJECT: Execution default-test of goal org.apache.maven.plugins:maven-s<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0ae11b307b0c0acde3e7dd0d39dc7235?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrbhawsar<br \/>\njava maven slf4j<br \/>\n[ERROR] Failed to execute goal on project slf4j-log4j12: Could not resolve dep dencies for project org.slf4j:slf4j-log4j12:jar:1.6.7-SNAPSHOT: Failed to coll t dependencies for [org.slf4j:slf4j-api:jar:1.6.7-SNAPSHOT (compile), log4j:lo j:jar:1.2.17 (compile), junit:junit:jar:3.8.1 (test)]: Failed to read artifact escriptor for log4j:log4j:jar:1.2.17: Could not transfer artifact log4j:log4j: m:1.2.17 from\/to central (http:\/\/repo.maven.apache.org\/maven2): Connection to tp:\/\/repo.maven.apache.org<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/86c2307bf4a20f6968e1f138c019d4bc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMouhammed Soueidane<br \/>\njava json cxf jboss7.x<br \/>\nI&#8217;m having a hard time implementing a REST web service using Apache CXF 2.x. I have a strict requirement to use JBoss AS 7.1.1 Final, which comes equipped with CXF 2.4.6. I have installed JBossWS 4.1.1: Apache CXF integration stack which upgrades the CXF version to 2.6.4. I&#8217;m using Eclipse Kepler SR1 in which I had to install &#8220;JBossAS Tools&#8221; so I could set JBoss AS 7.1.1 as my project runtime. The following are the different classes I&#8217;m using as well as my web.xml:Web.xml &lt;?xml version=&#8221;1.0<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/UuzUF.png?s=32&amp;g=1\" \/><br \/>\nBalint Pato<br \/>\njava eclipse jboss jboss-tools<br \/>\n1st phase I have a problem shutting down my running JBoss instance under Eclipse since I changedthe JNDI port of JBoss. Of course I can shut it down from the console view but not withthe stop button (it still searches JNDI port at the default 1099 port). I&#8217;m lookingforward to any solutions. Thank you! Used environment: JBoss 4.0.2 (using default) Eclipse 3.4.0. (using JBoss Tools 2.1.1.GA)Default ports: 1098, 1099 Changed ports: 11098, 11099I changed the following part in jbosspath\/server\/defa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d80ce5271185447eb06b360959acd71f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndeamon<br \/>\njava maven-2 servlets jetty maven-3<br \/>\nWhen I try to run my project with Maven 3 instead of Maven 2.1, I get an exception from the jetty-maven-plugin. Everything is fine with Maven 2.1.The config looks like this:&lt;plugin&gt;&lt;groupId&gt;org.mortbay.jetty&lt;\/groupId&gt;&lt;artifactId&gt;jetty-maven-plugin&lt;\/artifactId&gt;&lt;version&gt;8.0.0.M1&lt;\/version&gt;&lt;configuration&gt;&lt;scanIntervalSeconds&gt;1&lt;\/scanIntervalSeconds&gt;&lt;stopPort&gt;9966&lt;\/stopPort&gt;&lt;stopKey&gt;foo&lt;\/stopKey&gt;&lt;\/configuration&gt;&amp;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fd7fb5a87e5a604663949ecc643dc4a4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nfge<br \/>\njava apache sql-server-2008 tomcat jndi<br \/>\nThe DB is : MSSQL 2008 R2 OS= Windows Server 2008 R2Global Resource in server.xml is:&lt;Resource name=&#8221;data source name&#8221; auth=&#8221;Container&#8221; type=&#8221;javax.sql.DataSource&#8221; username=&#8221;myuser&#8221; password=&#8221;abc@xyz&#8221; driverClassName=&#8221;com.microsoft.sqlserver.jdbc.SQLServerDriver&#8221; url=&#8221;jdbc:sqlserver:\/\/host:1433;databaseName=test1;selectMethod=cursor&#8221; maxWait=&#8221;30000&#8243; maxActive=&#8221;32&#8243; maxIdle=&#8221;4&#8243; initialSize=&#8221;4&#8243; timeBetweenEvictionRunsMillis=&#8221;600000&#8243; minEvictableIdleTimeMilllis=&#8221;600000&#8243; \/&gt;&lt;\/GlobalNaming<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fc9d09c528879d7921086afe4279269d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAndrea Girardi<br \/>\njava web-services alfresco<br \/>\nI&#8217;m trying to connect to a remote Alfresco webservice using this java instrunction:WebServiceFactory.setEndpointAddress(configFile.getProperty(&#8220;WebServiceFactory&#8221;));AuthenticationServiceSoapBindingStub authenticationService = (AuthenticationServiceSoapBindingStub) new AuthenticationServiceLocator().getAuthenticationService();The authentication fails because the authority properties of AuthenticationServiceSoapBindingStub it&#8217;s not remote URL but it&#8217;s localhost:8080. How can I fix that? the stack<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5453adf47b82dac0fc433430ddc024a7?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nuser2746448<br \/>\njava hadoop amazon-web-services amazon-ec2<br \/>\nI have setup amazon ec2 instance and installed hadoop-1.0.4 single node, started all hadoop components, and working fine.I tested hadoop cluster by uploading file using hadoop command and working fine.When i am accessing hadoop cluster through java code, I am getting following exceptionfailed on connection exception: java.net.ConnectException: Connection refused: no further information\/etc\/hosts file127.0.0.1 localhost 127.0.0.1 ec2-x.x.x.x.compute-1.amazonaws.com ip-x.x.x.x.ec2.internalcore-s<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/546bf19821577387a0e24f83043a35d8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nnewnewbie<br \/>\njava jar<br \/>\nI tried to run my javaprojekt via java -jar myproject.jarand got:Failed to load Main-Class manifest attribute from myproject.jarHow can this be? I got my jar pretty much out of the box, using NetbeansOk, I found something that looks as if it could be a manifest file, so here it is:Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: Apache Maven Built-By: someone Build-Jdk: 1.7.0_25Ok, so here is the class:public class Starter {private static Control c;\/**** @param *\/public static<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2a3056517f42ad77f256b553c58731f8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAnand<br \/>\njava eclipse spring tomcat struts2<br \/>\nI use tomcat. I am developing a web application using struts2, and I use eclipse as my IDE for development.I get this errorMar 7, 2010 7:38:42 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory class:org.apache.struts2.spring.StrutsSpringObjectFactory &#8211; bean &#8211; jar:file:\/C:\/Documents%20and%20Settings\/Lakshmanan\/My%20Documents\/My%20Dropbox\/Final%20year%20project\/Workspace\/.metadata\/.plugi<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0ace3707d59b250045159a8493d8a6ea?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAkhil K Nambiar<br \/>\njava eclipse spring maven<br \/>\nFollowing is the errorSEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base C:\\Users\\akhil nambiar\\workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp3\\wtpwebapps\\CGSang does not exist or is not a readable directoryat org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:141)at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4713)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0bd0e9acf8a53b0928cbc8ff386edce5?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nuser2816277<br \/>\njava spring tomcat spring-mvc<br \/>\nI have this error when i start tomcat2013-09-26 10:27:24,616 INFO [localhost-startStop-1] UrlRewriteFilter.(Log.java:227) &#8211; loaded (conf ok) 2013-09-26 10:27:24,657 DEBUG [localhost-startStop-1] LocaleFilter.(GenericFilterBean.java:172) &#8211; Initializing filter &#8216;localeFilter&#8217; 2013-09-26 10:27:24,657 DEBUG [localhost-startStop-1] LocaleFilter.(GenericFilterBean.java:197) &#8211; Filter &#8216;localeFilter&#8217; configured successfully 2013-09-26 10:27:24,693 DEBUG [localhost-startStop-1] SessionFilter.(GenericFilte<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/85735330505ef1c84896fcb86491bd0b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRalph<br \/>\nspring jpa-2.0<br \/>\nlog4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvironment). log4j:WARN Please initialize the log4j system properly. Exception in thread &#8220;main&#8221; org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#8217;emfBean&#8217; defined in class path resource [SHContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org\/hibernate\/internal\/util\/ClassLoaderHelperat org.springframework.beans.factory.su<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e3a6d6b45fdb0f5d8e79e0db82a75804?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmiho<br \/>\njava spring localization<br \/>\nI&#8217;m instantiating a ReloadableResourceBundleMessageSource like the following as Spring bean.&lt;bean id=&#8221;resourceBundleMessageSource&#8221; class=&#8221;org.springframework.context.support.ReloadableResourceBundleMessageSource&#8221;&gt;&lt;property name=&#8221;basename&#8221; value=&#8221;locale\/messages&#8221;\/&gt;&lt;property name=&#8221;cacheSeconds&#8221; value=&#8221;-1&#8243;\/&gt;&lt;property name=&#8221;defaultEncoding&#8221; value=&#8221;UTF-8&#8243;\/&gt; &lt;\/bean&gt;And then use it in my service bean like that:@Qualifier(&#8220;resourceBundleMessageSource&#8221;) private final Reloada<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9afe3597724802312b2eb7aebad51ca8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nyasar<br \/>\nspring maven spring-transactions hibernate3<br \/>\nnow i am getting this error &#8230;.still i don&#8217;t know how to fix&#8230;.please atleast try to solve this error &#8230;however i can&#8217;t deal toahead..!!!!!!!!!HTTP Status 500 &#8211; type Exception reportmessage description The server encountered an internal error () that preventedit from fulfilling this request.exception org.springframework.web.util.NestedServletException: Requestprocessing failed; nested exception is java.lang.ClassCastException:java.lang.Integer cannot be cast to java.lang.Longorg.springframewo<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0ec667ff59b728e47cb4567ea9bc2703?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nnewbie<br \/>\nspring jsp spring-mvc web-hosting<br \/>\nI&#8217;m trying to upload my web app on eatj site. But I&#8217;m getting this error. I tried it in my local and its working perfectly fine and I can&#8217;t really figure it out what is the error.org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#8216;org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor&#8217;: Instantiation of bean failed; nested exception is java.security.AccessControlException: access denied (&#8220;java.lang.reflect.ReflectPermission<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3ee57556fd1befd1d7823fe987ac1e7c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njavacoder<br \/>\njava spring rabbitmq amqp spring-amqp<br \/>\nI&#8217;m trying out RabbitMQ for the first time and decided to go with the Spring AMQP wrapper. I was planning to test the write performance first and set up a sender to a queue:Spring setup:&lt;rabbit:connection-factory id=&#8221;connectionFactory&#8221; host=&#8221;localhost&#8221; username=&#8221;guest&#8221; password=&#8221;guest&#8221; \/&gt;&lt;rabbit:admin connection-factory=&#8221;connectionFactory&#8221; \/&gt;&lt;rabbit:template id=&#8221;myTemplate&#8221; connection-factory=&#8221;connectionFactory&#8221;exchange=&#8221;myQueue&#8221;\/&gt;Sender Main:ApplicationContext context = new C<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0c24f2667aa874c94d0f25d3f97a47ec?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nalexei.vidmich<br \/>\nspring<br \/>\nI am using @PostConstruct annotation (to mark init method in a bean) in Spring version 3.0.0.RC1. I start this web application in Jetty and get the following exception:java.lang.NoSuchMethodError: org.springframework.core.OrderComparator.sort(Ljava\/util\/List;)Vat org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:520)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/RAa8E.jpg?s=32&amp;g=1\" \/><br \/>\nUnheilig<br \/>\nspring spring-mvc weblogic<br \/>\nI am getting the below exception, when I try to publish my Spring MVC Webapp:Context initialization failed || java.lang.LinkageError: loaderconstraint violation: loader (instance oforg\/springframework\/context\/support\/ContextTypeMatchClassLoader$ContextOverridingClassLoader)previously initiated loading for a different type with name&#8221;org\/apache\/http\/params\/HttpParams&#8221; atjava.lang.ClassLoader.defineClass1(Native Method) atjava.lang.ClassLoader.defineClassCond(Unknown Source) atjava.lang.C<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0d6ba7cda9f2af763c7126cbe6e9de0d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPatrick Cornelissen<br \/>\njava spring reflection spring-mvc annotations<br \/>\nWe&#8217;re building some kind of automatic self describing REST service (live doc generation). For this we have a controller method that looks for all controller beans and fetches also the requestmapping information to display them in a nice friendly html page.For this we use the MetadataReader (created via CachingMetadataReaderFactory) to fetch the Metadata of the class. When we get the MethodMetaData for the public methods we find the RequestMapping annotation along with produces and value paramete<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d5cd529d1df7991e69908ed61ecbe0ee?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nYves Nicolas<br \/>\nspring jdbc annotations<br \/>\nI am trying to configure a database access in spring with javabased configuration following guidelines given in this good article about profiles configuration. For some reason I do not get, the injection process fails when I execute the following test :@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { com.dynamease.core.config.MainConfig.class }) @ActiveProfiles(&#8220;dev&#8221;) public class MySQLDBTests {@AutowiredDynUserInDbDao dbAccess;@Testpublic void testouverture() {assertNot<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/031c656239e481086f37717b07b17522?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCan&#8217;t Tell<br \/>\njava reflection annotations nullpointerexception<br \/>\nI&#8217;m following this tutorial on Java annotaitons and implemented the Test annotation as shown there. But when running the code I get the following output.java.lang.NullPointerExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:616)at TestAnnotationParser.parse(Demo.j<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/574afae0c3a7fae1b604ffe931318d3d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMiklos Krivan<br \/>\njava-ee annotations glassfish<br \/>\nThis simple Wicket page works perfect in GlassFish 3.1.2.2 server but does not work when deployed in GlassFish 4.0. Very important to note that other pages not containing @Resource annotation work perfect.public class IndexPage extends WebPage {\/\/ this EJB injection works as expected@EJB(name = AnyManager.NAME)AnyManager anyMgr;\/\/ this JNDI Resource is defined as java.util.Properties at JNDI\/Custom Resources of GlassFish admin console\/\/ this resource can be looked up using normal InitialContext.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e32d4bbe6ef4433b7afe21a9ae45d720?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\npatschiboy<br \/>\nobjective-c annotations ios7 mkmapview<br \/>\nWe&#8217;ve seen an unexpected behaviour in one of our apps &#8211; one one screen we&#8217;re showing annotations on a map view and the user can change the annotations on display by clicking a button.When we rebuild the app with iOS7 the screen would freeze regularly, i.e. no more user input was possible on the MKMapView once the code below had been called several times (with different sets of annotations) &#8211; the view is embedded in both a tab bar and a nav controller and all of their UI elements still worked, bu<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d5f91983a9d9cfb69981b6108a63b412?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nskaffman<br \/>\njava xml spring annotations spring-security<br \/>\nhow to add @Secure annoatation in controller&#8217;s method and make it run? Now when I run it the got the exception like :org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#8216;companyController&#8217; defined in file [C:\\workspace\\sts\\springsource\\vfabric-tc-server-developer-2.6.1.RELEASE\\spring-insight-instance\\wtpwebapps\\BillingEngine\\WEB-INF\\classes\\com\\sesami\\common\\management\\web\\controller\\CompanyController.class]: Initialization of bean failed; nested exception is o<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/24aa1542372e04f5d658974692ef6b89?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmeshy<br \/>\njava annotations<br \/>\ni have a child Class, that needs an Annotation, that is declared in the Parent class removed. What is the best way to do this?public class Parent@MyAnnoation String foobar;}public class Child extends Parent { \/\/here I only want to remove the @MyAnnotation from String foobar;}What I want to avoid is, &#8220;overriding&#8221; the memberpublic class Child extends Parent {String foobar;}as this has several disadvantages (as it &#8220;covers&#8221; the underlaying parent member = this.foobar can be different to super.foobar<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/642eea8127a7695eed5a2f3ba8360b5a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGreg Mattes<br \/>\njava annotations<br \/>\nWhat are the best practices for using Java&#8217;s @Override annotation and why? It seems like it would be overkill to mark every single overridden method with the @Override annotation. Are there certain programming situations that call for using the @Override and others that should never use the @Override?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/92721e3250050805394dd115fe876f71?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1217209<br \/>\nannotations nested constraints invocationhandler<br \/>\nI would like to use a class level annotation constraint. However I cannot get the inner constraints to validate automatically. I&#8217;d like to help with one part, to incorporate validation groups into this technique.@ConstraintA({@ConstraintB(stuff),@ConstraintB(stuff, groups=SomeGroup.class) }) public class Form{ }I currentily trigger the constraints like so.if(constraint instanceof ConstraintB){new ConstraintBValidator().isValid(target, context);}However this sucks obviously.I will eventually refa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ec23f7cf0263a623bea6aca36a77a58b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMichael Petrotta<br \/>\njava hibernate annotations<br \/>\nCan someone describe the use of annotation processing? My last attempt to understand annotations was unsuccessful.Previously I posted this question but couldn&#8217;t get a satisfactory answer. I went through many online tutorials but most of them are about annotations used for:Documentation Annotations used by the compiler (@Deprecated, @Override, @SuppressWarnings) Annotation processing (@Target and @Retention)Please someone explain me Annotation Processing by directing me to appropriate tutorial.To<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/df919b29c11d61a2daced347256cf36a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njasonfungsing<br \/>\nmongodb spring-data spring-data-mongodb spring-mongo<br \/>\nI have been google for a while, not sure whether Spring Data MongoDB supports for bulk save.I need to save a collection of documents into mongo as atomic, either all saved or none saved.Can anyone share a link or some sample code for this?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ecad987ae3e43f8d78794b207d3db6d7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDjordje Ivanovic<br \/>\njava spring hibernate jpa spring-data<br \/>\nI have webapp with Spring, Hibernate\/JPA and Spring Data. I created repositories that extends JpaRepository for some entitites and everything were just fine with default methods like .save(T) or saveAndFlush, findAll, even with findBy, if some field name is simple as id (findById) or findByRole &#8211; where Role is enum or findByActive where active is the boolean field in given Entity. But when I try to do the same with fields which are complex object, I get into the trouble. I have enetity named Pe<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8f5222c8dd89d2c52a67998eeb5b0fd3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKaliyug Antagonist<br \/>\nspring hadoop spring-data<br \/>\nI&#8217;m trying out Spring Data &#8211; Hadoop for executing the MR code on a remote cluster from my local machine&#8217;s IDEHadoop 1.1.2, Spring 3.2.4, Spring-Data-Hadoop 1.0.0applicationContext.xml :&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt; &lt;beans xmlns=&#8221;http:\/\/www.springframework.org\/schema\/beans&#8221;xmlns:xsi=&#8221;http:\/\/www.w3.org\/2001\/XMLSchema-instance&#8221; xmlns:hdp=&#8221;http:\/\/www.springframework.org\/schema\/hadoop&#8221;xmlns:context=&#8221;http:\/\/www.springframework.org\/schema\/context&#8221;xsi:schemaLocation=&#8221;http:\/\/www.springf<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/74f968336365385471af8a7536bb1d3b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1734143<br \/>\njboss7.x aspectj spring-data jboss-eap-6<br \/>\nWe are upgrading JBoss from 5 to EAP 6.1We are getting following error during deployment. Anyone faced similar issue?Error creating bean with name xyzSessionFactory defined in class path resource [applicationContext-xyz-dao.xml]: Cannot resolve reference to bean xyzDataSource while setting bean property dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name xyzDataSource: Post-processing of the FactoryBeans object failed; nested<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0d41db2d5e040f2207789fd24710f93b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\navh<br \/>\njava spring neo4j spring-data spring-test<br \/>\nI evaluate some stacks accessing neo4j (2.0.0) and have some problems with spring (3.2.6). What I am trying to achieve right now is very simple: a unit test connecting the graph and reading a node. My application context looks like this:&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt; &lt;beans xmlns=&#8221;http:\/\/www.springframework.org\/schema\/beans&#8221;xmlns:xsi=&#8221;http:\/\/www.w3.org\/2001\/XMLSchema-instance&#8221; xmlns:context=&#8221;http:\/\/www.springframework.org\/schema\/context&#8221;xmlns:tx=&#8221;http:\/\/www.springframework.org\/s<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d634920964f627e123d120f28322c4ca?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChetan<br \/>\njava spring jpa spring-data<br \/>\nI am trying to setup a project on spring data, but running into strange errors like this:problem with handler class file or dependent class; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.springframework.data.jpa.repository.config.JpaRepositoryConfigDefinitionParserI have specified the proper schema namespace as guided in spring data JPA documententation site.xmlns:jpa=&#8221;http:\/\/www.springframework.org\/schema\/data\/jpa&#8221;xsi:schemaLocation=&#8221;http:\/\/www.springframewo<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/48cfe5767eacc4cc2c8fbf1b116b5dea?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nromedius<br \/>\nhadoop hbase spring-data<br \/>\nI&#8217;m using spring data + hbase to write some values into a HBase database. Unfortunately the HbaseTemplate seems to close the connection after the first call.I&#8217;m new to Spring and HBase\/Hadoop, so i don&#8217;t know if this is a Spring\/HBase Configuration issue or another stupidityTestclass:package org.springframework.data.hadoop.samples;import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.util.Bytes; import org.junit.Test; import org.j<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e70d308c51c3a6a7f29921e4e025a413?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nimamc<br \/>\nspring neo4j spring-data spring-data-neo4j<br \/>\nI&#8217;ve got some data that has been pumped into a neo4j instance using the native api. The same instance is used by an app backed by Spring data graph. The repositories fail to find the data. I&#8217;m assuming that this is an issue due to indexes and\/or missing properties.When the data is pumped in the following properties are set:node.setProperty(&#8220;__type__&#8221;, &#8220;com.x.x.Class&#8221;);Index is set as follows:Index&lt;Node&gt; typeIndex = indexManager.forNodes(&#8220;__types__&#8221;); typeIndex.add(node, &#8220;className&#8221;, &#8220;com.x<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d9269818df2a058ad6bf9dbbaf1e8240?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrmuller<br \/>\nspring-data spring-data-mongodb<br \/>\nI want to customize \/ configure the serialization policy of spring-data-mongodb (version 1.1.1.RELEASE) without using annotations (like @Id, @Document, @Field) because I do not have access to the domain classes.Is this possible? If yes, what is the most efficient way to do this?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a02fe611d3c1ba997bae2eb2d1925522?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndmahapatro<br \/>\nsql hibernate grails spring-data<br \/>\nI have a situation in Hibernate where I need to get the count(*) on a SQL EXCEPT query. Below is the query ( imitated my original code ):String query = &#8220;&#8221;&#8221; select count(*) as totalCount from ( select distinct id from Employee where name like &#8216;%Roger% EXCEPT select distinct id from Manager ) Temporary&#8221;&#8221;&#8221;Now, when I say:hibernateSession.createQuery(query);The below exception is thrown:org.hibernate.hql.ast.QuerySyntaxException: unexpected token: ( near line 1, column 36My logs also show the below<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/mILYM.jpg?s=32&amp;g=1\" \/><br \/>\nSitansu<br \/>\njava spring spring-data-jpa spring-boot<br \/>\nWhy does the addition of @EnableAutoConfiguration to the following spring-boot app cause it to not create an entityManagerFactory? If I remove @EnableAutoConfiguration everything works fine. Can anyone shed light on this behaviour?package test.builder;import javax.sql.DataSource;import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; im<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/db83cf641ff371bbd5016456dd164288?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCFL_Jeff<br \/>\njava hibernate inheritance jpa spring-data-jpa<br \/>\nConsider the following hierarchy, where entities WidgetA and WidgetB extend an abstract Widget superclass:@Entity @Inheritance(strategy = InheritanceType.JOINED) public abstract class Widget implements Serializable {@Column(name=&#8221;serialNumber&#8221;, length=64, nullable=false, unique=true)private String serialNumber;&#8230;and@Entity public class WidgetA extends Widget implements Serializable { &#8230;and@Entity public class WidgetB extends Widget implements Serializable { &#8230;I need to search for Widgets b<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ef3dfb86a6c8249fe0c0de25dd9d9e38?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nLeonard Br\u00fcnings<br \/>\nspring hibernate spring-data-jpa spring-transactions<br \/>\nIn our Tests we see this mysterious StackOverflowError in our logs. Our tests still complete normally, but I&#8217;d still like to fix it if possible. Any ideas what is causing this infinite recursion and how to fix it?13569 [main] DEBUG org.hibernate.SQL &#8211; select sequence_next_hi_value from hibernate_sequences where sequence_name = &#8216;IDS&#8217; for update Hibernate: select sequence_next_hi_value from hibernate_sequences where sequence_name = &#8216;IDS&#8217; for update 13570 [main] DEBUG org.hibernate.SQL &#8211; insert i<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9b8612f4dbb037edc0f5ce82df05adde?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbalteo<br \/>\nspring hibernate jpa spring-data-jpa<br \/>\nI have an issue with a Spring controller method. It actually does two updates on the same entity which causes the StaleObjectStateException. The problem is that when I retrieve the Member instance, I think it somehow causes an update (see \/\/UPDATE ONE) of the Advertisement instances (this is not wanted actually) and when I update the Advertisement instance (see \/\/UPDATE TWO), then it throws a StaleObjectStateException.My question is how can I prevent this exception from occurring in my case (bea<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1aaf9d211e31aaa2faf479ee96e45807?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1555190<br \/>\nspring jpa-2.0 spring-data-jpa<br \/>\nI have query as such :@Query(&#8220;select a from Ability a where a.eventLogic = ?1 AND a.abilitySetId = ?2 ORDER BY RAND() LIMIT ?3&#8221;)BUt i get an error:Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: LIMIT near line 1, column 117How can i programmatically put in the limit number?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cf1b1ffa204cf0dcb173ff527a6cfb53?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMariusz<br \/>\nhibernate jpa spring-data-jpa<br \/>\nI use JPA with hibernate. I want to check that row with specified name and username exists. The following query raises an error:@Query(&#8220;select exists (select 1 from Strategy s where s.name=:name and s.username=:username)&#8221;) Boolean exists2(@Param(&#8220;name&#8221;) String name,@Param(&#8220;username&#8221;) String username);Error:Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [select exists (select s from com.soft.domain.strategy.Strategy s where s.name=:name and s.username=:username)]<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/MVk6m.gif?s=32&amp;g=1\" \/><br \/>\ndhroove<br \/>\njava hibernate exception jpa-2.0 spring-data-jpa<br \/>\nI don&#8217;t know if this approach is the best or not. But I have a requirement where I need to handle Spring JPA repository (DAO layer) exception. Handle in the sense may be propogate it to UI or may be do some logic on service layer.Now as per present scenario from over repositories all our SQL Exception got wrapped into Runtime exception DataAccessException.Now one way if I want to propogate this Exceptions to my UI layer than I catch this Runtime Exception on Service layer and wrap this exception<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/92997c3fbc76408f78debe6bc53c5bb3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nchrylis<br \/>\njava spring configuration annotations spring-data-jpa<br \/>\nI&#8217;ve got the spring configuration class:@Configuration @EnableJpaRepositories InfrastructureContextConfiguration@Beanpublic LocalContainerEntityManagerFactoryBean entityManagerFactory() {&#8230;}I wish to set the entityManagerFactoryRef attribute of the @EnableJpaRepositories with entityManagerFactory().getObject() invocation. Can I do that and how if it is allowed?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b8cb5d6d43ed44788472b977cef6f1d7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMatt Whipple<br \/>\nspring-data-jpa<br \/>\nI&#8217;m presently struggling with getting Spring Data JPA Auditing to work, it is presently not setting the fields and doesn&#8217;t seem to be getting called in any way when working with Entities. In particular any insight into how it hooks into the standard flow of persisting Entities would be helpful.I&#8217;m presently using Spring Data JPA 1.5.0.M1 with Spring 3.2.6 and the basic configuration for the auditing piece is:@Configuration @EnableJpaAuditing(auditorAwareRef = &#8220;auditorAware&#8221;) @EnableJpaRepositor<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9b8612f4dbb037edc0f5ce82df05adde?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbalteo<br \/>\njpa spring-roo spring-data spring-data-jpa<br \/>\nI use Spring Roo + Spring Data + QueryDSL and I have the following classes\/interfaces:public interface FamilyAdvertisementRepositoryCustom { }@RooJpaRepository(domainType = FamilyAdvertisement.class) public interface FamilyAdvertisementRepository extends FamilyAdvertisementRepositoryCustom { }public class FamilyAdvertisementRepositoryImpl extends QueryDslRepositorySupport implements FamilyAdvertisementRepositoryCustom {\/\/NO CONSTRUCTOR }all in following package: com.bignibou.repository;With foll<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PhoenixLament java android android-camera I am interested in writing an app for android where after a certain event in the app a photo is automatically taken using the camera on the android. Things I need:No Preview of photo No Button for User to press to take the photo Just run the operation to take a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5668","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5668"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5668\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}