Hot questions for Using Azure in intellij idea

Top Java Programmings / Azure / intellij idea

Question:

I'm trying to configure the azure plugin for intellij so that I can deploy my spring project to tomcat directly from my IDE. I'm sure I'm doing something stupid since I can't get it to work and I can't find ANYTHING as far as directions or other people struggling.

I've tried following the directions listed here: http://blogs.msdn.com/b/ashish/archive/2014/10/27/new-azure-tooling-for-intellij-idea.aspx

These directions lead me to believe that I should be able to set up my project to deploy to my tomcat instance without having to use ftp or any other such method,

Everything goes well for me until I get to the part that says:

Now that it is ready, we will configure the application to publish/deploy to Azure. With the installation of the Azure plugin, new tools are available to configure and deploy to Azure. Select ‘publish to Azure’.

I'm not sure where I can find the "Publish To Azure" to start the wizard that the final steps talk about.

I have successfully imported my subscription and that seems to be working fine.

Any help to get me past this hurdle would be greatly appreciated.


Answer:

You have to display the main toolbar by selecting View -> Toolbar. There you can see the new Azure Tool Buttons.

Question:

I want to use timerTrigger in azure functions. I created function according this guide: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-maven-intellij it is generated by default httpTrigger. I tried command of azure-functions:add. I succeeded adding timerTrigger but I encountered with a lot of errors

How I can delete httpTrigger and declaring only timerTrigger? before I run the azure-functions:add:

after running the command:

I guess it is related to azure plugin and maven plugin conflict but not sure and I don't know how to handle such this situation

any help will be appreciated

thanks


Answer:

For now, I suppose it doesn't support create java function with default timer trigger. However you could delete the HTTP one then create the timer, cause you don't provide much information so maybe you could refer to my steps.

  1. Create the function with maven.(I'm using the 1.22 version)
  2. Delete the HTTP function, and delete the test folder.

  3. Create the Timer Trigger function. After this the project will be like this.(Before packaging remember set the storage connection string in the local.settings.json)

  4. Package it.(Use the package method in the Lifecycle.)

  5. Run it with azure-functions:run under azure-functions plugin.

Question:

I am using hibernate with InteliJ Idea ultimate, every time I try to Generate Persistence mapping of my tables, it generates them with slightly incorrect @Table name

My database structure - IMGUR IMAGE

so my correct table name for "Activity" table would be: "[dbo].[Activity]"

but InteliJ generates it like this:

@Table(name = "Modules", schema = "dbo", catalog = "test-V4ClientDb")

And it causes errors where it can not retrieve data:

ERROR: Incorrect syntax near '-'. org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.getResultSet(AbstractLoadPlanBasedLoader.java:434) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeQueryStatement(AbstractLoadPlanBasedLoader.java:186) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:121) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:86) at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.load(AbstractLoadPlanBasedEntityLoader.java:167) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4004) at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:508) at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:478) at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:219) at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:278) at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121) at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89) at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1220) at org.hibernate.internal.SessionImpl.access$1900(SessionImpl.java:203) at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.doLoad(SessionImpl.java:2767) at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2741) at org.hibernate.internal.SessionImpl.get(SessionImpl.java:1056) at hibernate.DatabaseManager.retrieveModuleFromDatabase(DatabaseManager.java:82) at hibernate.DatabaseManager.populateDatabase(DatabaseManager.java:58) at runner.TestRunner.setUp(TestRunner.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.api.junit.Cucumber.run(Cucumber.java:100) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at org.testng.junit.JUnit4TestRunner.start(JUnit4TestRunner.java:81) at org.testng.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:69) at org.testng.TestRunner$1.run(TestRunner.java:697) at org.testng.TestRunner.runJUnitWorkers(TestRunner.java:1004) at org.testng.TestRunner.privateRunJUnit(TestRunner.java:728) at org.testng.TestRunner.run(TestRunner.java:629) at org.testng.SuiteRunner.runTest(SuiteRunner.java:366) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319) at org.testng.SuiteRunner.run(SuiteRunner.java:268) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244) at org.testng.TestNG.runSuitesLocally(TestNG.java:1169) at org.testng.TestNG.run(TestNG.java:1064) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:135) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeSingleClass(TestNGDirectoryTestSuite.java:112) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:146) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '-'. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:254) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1608) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:578) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:508) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7240) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2869) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:243) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:218) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:434) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70) ... 56 more

is there a possibility to configure InteliJ to use correct naming?

I am using Microsoft Azure sql server.

Thank you.

EDIT

It also works if there is no "catalog" specified

@Table(name = "Modules", schema = "dbo")

So question still is, how to configure InteliJ hibernate tool to use correct naming.


Answer:

Looks like you cannot use the caracter "-" in your catalog string.