Quantcast
Channel: JetBrains Developer Community : All Content - IntelliJ IDEA Users
Viewing all 5481 articles
Browse latest View live

Gradle refresh in a project that has no gradle

$
0
0

I have an IntelliJ project with a few modules. However, they all use maven. Not one of them has gradle. However, whenever I run maven to build outside IDEA and I go back into IDEA, it always refreshes my gradle project. If I look in JetGradle, it has all my modules in my project, plus one more that is not in my project at all. That one does have a gradle build. Why it is showing in my project, when it isn't actually there, I have no idea, and there is no way to remove it from JetGradle. It is very frustrating. At least in the maven built in plugin I can remove pom files.

 

Thanks

 

Mark


More flexible customizable templating

$
0
0

So a new zen coding like experience has been created called hayaku

 

 

http://hayakubundle.com/

 

It could sort of work with regex based live templates as noted here:

 

http://youtrack.jetbrains.com/issue/IDEA-29982

 

oh

o:h

ovhi

overfl:hidn

 

all create

 

overflow: hidden

 

and these are other examples

 

h10 -> height: 10px

ml-1.5 -> margin-left: 1.5em (switches to em by default since there can't be a point decimal value)

w50p -> width: 50%

cF -> color: #fff

bg80 -> background: #808080

 

But really it's about bringing in customizability into the IDE without having to build a java plugin. IntellijEval looks good but it isn't as deeply integrated as this though maybe it can be. Perhaps as a workaround, is there a way to trigger text processing for text to the left of the cursor without selecting the text and have that processing done via an external script? It isn't just that hayaku is nice, and that its fast, but that it can be triggered the way Zen is with a tab. It doesn't break the flow and the source of it is easily modifiable without going through a compile/build cycle.

 

Just airing some thoughts here.

 

Message was edited by: Michael Wills Clarifications to workar

groovy and intelliJ 12 : why generate stubs?

$
0
0

I have part of a big project with parts that use groovy .... worked perfectly fine under version 11.1

switched to version 12 and then generation of stubs that do not compile afterwards!

what to do to avoid this pesky stub generation that does not work?

well there appears an "exclude from stub generation" form : am I to do that for hundreds of groovy classes?

thanks

Resource Bundle editor issues.

$
0
0

Good morning,

 

I have two issues (well, one issue and one feature request actually) regarding the resource bundle/property editor. I just wanted to make sure that I don't miss anything nor that there are already a bug/feature request filed.

 

1. So the bug:

 

When I edit my resource bundles in IDEA I can switch between the property editor (where I can edit a single file) and the resource bundle editor. Now, each time I switch from the property editor to the resource bundle view the panel on the left side (where all your resource keys are listed) will be re-layouted to it minimum horizontal size. That is really annoying. I added a screenshot where you can see how it looks.

 

I'm using Ubuntu 12.04, JDK 1.7u10 and Idea IU 12.0. But i had the same behavior under previous versions of IDEA as well. So it is clearly not a regression bug.

 

2. About the feature request:

 

It would be really great if there would be a way to link the property editor with the resource bundle editor. So if I edit the line with key "a.b.c" in the property editor that key would also be selected in the resource bundle editor as well so I can see immediately all the other values for that key.

 

So my question is: is this already possible in IDEA?

 

Regards,

Stefan

IntelliJ12 - Which version of ActionScript Compiler 2.0 is used?

$
0
0

Hi,

 

I have a pure Actionscript project and enabled the "Prefer ActionScript Compiler 2.0 ..." setting. However, when I set "-advanced-telemetry=true" in the "Additional compiler options" I get an error:

 

[away3d-examples-fp11 - Intermediate_MD5Animation]: command line: unknown configuration variable 'advanced-telemetry'

 

Full command line below.

 

The same option works when using Adobe's latest mxmlc compiler directly.

 

Any ideas how to get this working?

 

Thanks,

Peter

 

---

 

[away3d-examples-fp11 - Intermediate_MD5Animation]: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -d32 -Dapplication.home=/Applications/flex-sdk/flex_sdk_4.6.0.23201B -Xmx384m -Dsun.io.useCanonCaches=false -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Duser.language=en -Duser.region=en -Xmx512m -classpath /Applications/IntelliJ IDEA 12.app/plugins/flex/lib/idea-flex-compiler-fix.jar:/Applications/flex-sdk/flex_sdk_4.6.0.23201B/lib/compc.jar flex2.tools.Mxmlc -load-config=/private/var/folders/R0/R098OWogHsOo-+ovbfapIbEWmac/-Tmp-/IntelliJ_IDEA/idea-EB3CD26B-F48E3040-Intermediate_MD5Animation.xml -advanced-telemetry=true

Hibernate console failing with error

$
0
0

I have a spring + hibernate application. When trying to use the hibernate console, I keep getting the following error

 

hql> from Person

java.lang.RuntimeException: org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]

at org.hibernate.cache.impl.NoCachingRegionFactory.buildEntityRegion(NoCachingRegionFactory.java:70)

at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:280)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)

at com.intellij.hibernate.console3.remote.HibernateFacadeImpl$1.buildSessionFactory(HibernateFacadeImpl.java:23)

at 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:601)

at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)

at sun.rmi.transport.Transport$1.run(Transport.java:177)

at sun.rmi.transport.Transport$1.run(Transport.java:174)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:173)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)

at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)

at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)

at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)

at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)

at $Proxy196.buildSessionFactory(Unknown Source)

at 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:601)

at com.intellij.execution.rmi.RemoteUtil$2$1$1.compute(RemoteUtil.java:99)

at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:160)

at com.intellij.execution.rmi.RemoteUtil$2$1.invoke(RemoteUtil.java:96)

at $Proxy196.buildSessionFactory(Unknown Source)

at com.intellij.hibernate.engine.HibernateEngine.ensureInitialized(HibernateEngine.java:117)

at com.intellij.hibernate.engine.HibernateEngine.createQuery(HibernateEngine.java:141)

at com.intellij.jpa.engine.JpaEngineBase.executeQueryInner(JpaEngineBase.java:166)

at com.intellij.jpa.engine.JpaEngineBase.access$000(JpaEngineBase.java:44)

at com.intellij.jpa.engine.JpaEngineBase$2.run(JpaEngineBase.java:128)

at com.intellij.jpa.engine.JpaEngineBase$1.run(JpaEngineBase.java:95)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

at java.util.concurrent.FutureTask.run(FutureTask.java:166)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

 

In my spring context file where hibernate is configured, I have second level cache turned on already. I also have a region factory class set.

 

<prop key="hibernate.cache.use_second_level_cache">true</prop>

<prop key="hibernate.cache.use_query_cache">true</prop>

<prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</prop>

 

Why does the hibernate console still fail with the above error?

 

Pls advice.

 

I am running current v12 (release version, build 123.72)

 

Thanks

Hibernate Console MappingNotFoundException with external jar resources

$
0
0

Hello all,

 

Seem to be having problems with the hibernate console seemingly not being able to find mapping resources from the jars in my projects ivy cache (i.e. inside project jars).

 

We've got a mix of annotations and old style hibernate hbm.xml files. My hibernate cfg file defines these xml files are mapping resources instead of mapping class. e.g.

 

     <mapping resource="com/company/project/persistence/hibernate/hbm/PersistentObject.hbm.xml"/>

 

When I attempt queries in the hibernate console I'm getting MappingNotFoundException for these older resources:

 

     java.lang.RuntimeException: org.hibernate.MappingNotFoundException: file: C:\Users\rosbaldeston\.ivy2\cache\com.compnay\hibernateutilities\jars\hibernateutilities-x.y.z.jar!\com\company\project\persistence\hibernate\hbm\PersistentObject.hbm.xml not found

 

 

The jar in question exists, the hbm.xml files inside the jar also exist. The IDE resolves and will navigate these mappings without problems. But for some reason the hibernate console can't?

 

 

I tried extratinf the hbm files into a package structured build folder and adding that to the classpath. However the IDE then highlighted all these Mappings as unresolveavble. When I click on them it's clear the IDE editor can see both sets of mapping file and seems confused by the aparent duplication. The hibernate console works a bit better the class it complained about resolves but I get a similar MappingNotFoundException  about mapping files hidden even deeper in the 3rd party jars (jbpm).

 

Wondering if I'm doing something wrong or if theres just a bug in the HQL console?

 

 

Using latest IntelliJ 11 (11.13) on Windows 7, Hibernate 3.5.6, and IvyIDEA if thats relevant at all.

Mavenized projects and JUnit tests

$
0
0

Hey all:

 

I am still learning the ins-and-outs of Maven and IntelliJ so forgive me if this is a silly question.

 

 

I have a Maven project where I am running JUnit tests against some webflow xml definitions. Each unit test has a relative path to the XML file, for example to load the manage order flow it is - > src/test/resources/config/spring/webflows/manageordertest-flow.xml.

 

So, int the JUnit there is a class level variable that refers to the path above. When I try to run my JUnit test in IntelliJ 12 I get the following exception.

 

Caused by: java.io.FileNotFoundException: src\test\resources\config\spring\webflows\manageordertest-flow.xml (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:120)
    at org.springframework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:110)
    at org.springframework.webflow.engine.model.builder.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:98)
    at org.springframework.webflow.engine.model.builder.xml.XmlFlowModelBuilder.init(XmlFlowModelBuilder.java:113)
    ... 31 more

 

When I run the test at the command line it works fine!  ( mvn test -Dtest=Mytest) No errors and all tests are "green".

 

Also, a fellow developer can run the test in Eclipse using the relative path as mentioned above. For me to run the test in IntelliJ I have to give the full path to the XML file (i.e. C:/xxxx/xxx/xxx/xxx/manageordertest-flow.xml)

I have checked my module settings and the xml file and associated test class file are set up and test sources in the sources pane.

Further, I check the output path and both my compiled classes as well as test classes and test resources are located in the appropriate  webapp/target/classes and webapp/target/test-classes directories.

 

 

What am I missing here? Any suggestions or pointers is greatly appreciated!

 

 

Thanks for your help.


Help.. what is this exception in scala plugin?

$
0
0

I am just trying to run some unit tests...

Any idea what this could be? Something on my side? A bug on the IDEA side?

Help.... (see attached screen shot)

Intellij 11 not respecting Code Style changes!

$
0
0

I'm writing an ActionScript project and there's one thing that Intellij IDEA does that I do not want it to. Intellij inserts a space after I type a comma in the function parameters (like func(a,<automatic space>b)). While I do like  spaces after my comma, it's pretty much habit for me to insert them myself. The problem is, I end up often with two spaces! Which does take some time to constantly go back and delete one of the spaces.

 

I found the Spaces tab, under Code Style -> ActionScript, and unchecked the "After comma" field under Other. However, the IDE still inserts the space! To further test things out, I checked "Before comma" and the IDE doesn't insert that space. Either I have the wrong settings or the IDE doesn't appear to be respecting the changes.

 

While I could get used to not inserting the space, I use other IDEs for other languages that don't give me that option so I'd rather keep consistency and insert the spaces manually.

 

Help?

 

Thanks,

C.J.

Can't create basic Servlet in 12

$
0
0

Trying to create just a basic Servlet is extremly frustrating in IDEA 12 (same as 11?)

 

Steps....

 

0. No IDEA 12 step by step documentation found, so....

 

1. I create a web project.

 

1.5. Added Tomcat App Server.

 

2. I create a package under src

 

3. I create a Servlet

 

Then notice that idea leaves a "{Package Name}" element in the servlet (that of course won't compile) even though there is a package statement. IDEA doesn't put a semi-colon after the package name at top. OK, fixed those.

 

4. Clicked in the web.xml and tried to enter the deployment descriptor elements. There's a "+" enabled, but clicking it ... NOTHING HAPPENS. Same for Servlet Mapping. Clicked and highligted everything I could possibly think of in web.xml and other parts of the "Web" view. Here again, the IDE is utterly confusing. There is an ENABLED "+" button for adding the Servlet mapping, but clicking it....NOTHING HAPPENS. Again.

 

---------

 

I also noticed that after entering some text in the servlet description, I was not able to edit it! Not sure what this feature is all about...

 

--------

 

Even after manually adding the servlet path information, I can't just "run" the web application and have the Servlet work. Sure, the HTML page (index.jsp) works OK, but the Servlet doesn't even look like it's deployed (possibly related to all the other problems above?) No idea.

 

Looking at the directories IDEA creates under the project (test, web, etc.), there's not a single directory with everything in it needed to work.

 

Why is this so difficult and so much apparent burdent put on the developer to "know" just exactly how "IDEA works"?

 

For what is relatively simple in other IDEs, it often seems more difficult to use IDEA than using advanced features of Java. I would prefer on banging my head on my app logic, not on the IDE. Yet, that's what I seem to often do with IDEA.

 

Am I honestly alone on this?

 

Sigh....

Easily Deploy to Tomcat Webapps Folder?

$
0
0

I like the way you can just run an IDEA web project using the ">" button. Nice. Everything works great ... as long as IDEA is loaded.

 

However, I'd also like to be able to easily deploy the application to tomcat webapps folder so it will run there without having IDEA loaded. I don't want to have to write an Ant script (yuck) to deploy to the local app server either.

 

Attempt 1:

 

So far, I don't see a quick and easy way to do just .... deploy to Tomcat's webapps folder.

 

I tried to add an "External" path to the Run settings (so it was there in addition to the war-exploded default), but that didn't seem to do anything. The application was not found under webapps.

 

------


Attempt 2:


Trying deploy to Tomcat's webapps folder another way....

 

When I copy the seemingly complete web app from the artifacts folder IDEA creates in the Artifacts directory and put it directly into Tomcat's Webapps, I get  the following errorwhen tryng to run the application:

 

type Status report

 

messageThis application is not currently available

 

descriptionThe requested service (This application is not currently available) is not currently available.

 

The application also does not show up in the Tomcat Manager application as a loaded application. It has a web.xml, an index.jsp, and, well everything I would expect, but no dice. Doesn't work.

 

-----------------

 

Any ideas what is going on?

 

I'd like to be able to deploy the exploded archive directly to Tomcat  instead of (or in addition to) the application folder so it's easily  runnable when IDEA isn't loaded.

 

I've been needing to know how to do this for a while so I'd really like to know what the magic is. It's not obvious (to me, that is) how to do this.

 

If this easy deploy capability isn't currently in IDEA, which I doubt is the case, please let me know and I'll add an "urgent" request to have it added.

 

If the easy deploy capability is available, what are the set of steps required to set it up?

 

Thanks,

 

- m

Air mobile background color and size

$
0
0

Hi,

How i can change the background color & stage size of an air for mobile project? i tried with SWF(width, height...) but doesnt work. i cant find the way to do that whith the IDE.

any suggestions???

Cannot generate hibernate mappings from schema

$
0
0

I am trying to get IDEA 12 to generate hibernate (4.1) mappings from schema but it doesnt like it. Every time, regardless of what combination of xml/annotations output, single table selection , etc, I use, it always fails with the error: "basic attribute type should not be object". Then, the OK button is always greyed out meaning I have to close the dialog and start again.

 

My pom.xml is:

 

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"

         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

 

    <groupId>Module_01</groupId>

    <artifactId>Module_01</artifactId>

    <version>1.0-SNAPSHOT</version>

    <dependencies>

        <dependency>

            <groupId>org.hibernate</groupId>

            <artifactId>hibernate-validator</artifactId>

            <version>4.2.0.Final</version>

        </dependency>

        <dependency>

            <groupId>org.hibernate.javax.persistence</groupId>

            <artifactId>hibernate-jpa-2.0-api</artifactId>

            <version>1.0.1.Final</version>

        </dependency>

        <dependency>

            <groupId>org.hibernate.common</groupId>

            <artifactId>hibernate-commons-annotations</artifactId>

            <version>4.0.1.Final</version>

        </dependency>

        <dependency>

            <groupId>org.hibernate</groupId>

            <artifactId>hibernate-entitymanager</artifactId>

            <version>4.1.5.SP1</version>

        </dependency>

        <dependency>

            <groupId>org.hibernate</groupId>

            <artifactId>hibernate-core</artifactId>

            <version>4.1.6.Final</version>

        </dependency>

        <dependency>

            <groupId>org.springframework</groupId>

            <artifactId>spring-core</artifactId>

            <version>3.1.2.RELEASE</version>

        </dependency>

        <dependency>

            <groupId>org.springframework</groupId>

            <artifactId>spring-context</artifactId>

            <version>3.1.2.RELEASE</version>

        </dependency>

        <dependency>

            <groupId>org.springframework</groupId>

            <artifactId>spring-orm</artifactId>

            <version>3.1.2.RELEASE</version>

        </dependency>

    </dependencies>

</project>

I have tried assigning the mappings to a sessionFactory and not but nothing works. I am using the OSS pagila schema on postgresql 9.2.1.
[UPDATE] After further hacking, it seems that if the tables that I am attempting to have mapped have foreign-key relationships with other tables that have not yet been mapped then it fails. If I choose a table that has no relations with other tables then it works fine. A bug? Does it work for anyone else?

Debugging Play2 Scala based tests in IntelliJ

$
0
0

Greetings all,

 

I am a newbie to Scala and am trying to debug some controller tests using IntelliJ12 Ultimate.

 

I can get the tests to run fine but can't seem to get the debugger to his a breakpoint that I have set in the controller.

 

Can anyone help out?

 

Thanks,

Mike


how can i use java6 web services support?

$
0
0

i'm trying to generate a client from wsdl file by choosing the metro/glassfish option, but it says a list of jars is missing (such as fastinfoset.jar) however when it suggest to download them from jetbrains site it fails saying " can't download jars + null "(btw i have no problem downloadign plugins)

Idea 12 - JSP Code-complete and Syntax Coloring

$
0
0

HI all,

 

I am checking out Idea 12 Community Editition to see if it justifies a prucahse of the full product.

 

Everything is great, however I can't seem to get support in JSPs. I have multi-module Maven projects, and I am trying to enabe code-completion and syntax highlighting.

 

Currently, ctrl-space in the JSP will pull up a list of ALL classes on the class path, but I cannot perform code completion for methods.

 

I've been trying both simple scriplets as well as taglibs.

 

The JSPs compile during maven build using the JSPC maven plugin, so I dont think there anything wrong them.

 

Thoughts?


Thanks

Intellij 12 not stopping at a breakpoint

$
0
0

Hi,

 

I just upgraded to Intellij 12 and I am investigating the jasypt (Java Simplified Encryption) library, http://www.jasypt.org/,

 

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.4</version>
      <scope>provided</scope>
      <!--<optional>true</optional>-->
    </dependency>
   
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk16</artifactId>
      <version>1.40</version>
      <scope>test</scope>
    </dependency>

  • and ran the unit test BouncyCastleByProviderStringEncryptorTest in the IDE debugger.
What I found is that when I set a break point in the bouncycastle library constructor class JCEBlockCipher.java or other classes where it should stop at a breakpoint.
The IDE does not stop at the breakpoint inside bouncycastle library.
Please let me know what I am doing wrong...
Thanx in advance
- Young
I believe this worked in Intellij IDE 11

Help.. what is this exception in scala plugin?

$
0
0

I am just trying to run some unit tests...

Any idea what this could be? Something on my side? A bug on the IDEA side?

Help.... (see attached screen shot)

Darcula

$
0
0

Hi Jetbrains,

 

is there any chance that the darcula theme will be made available for Nika?

 

Regards,

Jens

Viewing all 5481 articles
Browse latest View live