小编Use*_*sbs的帖子

如何在postgres中创建用户的重复角色

我需要一个新用户,但应该授予其他现有用户/角色所具有的所有权限.

例如

  • 用户A在Table1上具有SELECT权限
  • 用户A在Table2上具有EXECUTE权限
  • ...

如果创建了新用户B,我需要相同的权限,

  • 用户B对Table1具有SELECT权限
  • 用户B在Table2上具有EXECUTE权限
  • ...

不要问为什么:/

实际上,用户A对不同的表,模式和函数具有自定义权限; 所以手动授予新用户权限是一个非常繁琐冗长的过程.任何帮助都会很好.

postgresql user-roles

11
推荐指数
3
解决办法
1万
查看次数

Apache Tomcat 7,ant list = BUILD FAILED

对于简单的MVC springapp,我正在尝试部署Web应用程序."ant"和"ant deploywar"构建命令工作正常.做"蚂蚁列表"时出错

这是build.properties

appserver.home=/usr/local/apache-tomcat-7.0.47
appserver.lib=${appserver.home}/lib

deploy.path=${appserver.home}/webapps

tomcat.manager.url=http://localhost:8080/manager
tomcat.manager.username=tomcat
tomcat.manager.password=s3cret
Run Code Online (Sandbox Code Playgroud)

这是与build.xml中的列表相关的部分

<target name="list" description="List Tomcat applications">
    <list url="${tomcat.manager.url}"
             username="${tomcat.manager.username}"
             password="${tomcat.manager.password}"/>
</target> 
Run Code Online (Sandbox Code Playgroud)

经理正在浏览器中工作,我也可以浏览应用程序列表

OK: http://localhost:8080
OK: http://localhost:8080/manager
OK: http://localhost:8080/manager/html
OK: http://localhost:8080/manager/html/list
Run Code Online (Sandbox Code Playgroud)

当我从经理的HTML界面转到ListApplications时,它会转到

http://localhost:8080/manager/html/list?org.apache.catalina.filters.CSRF_NONCE=BFCB46A8A1735E7DA7FBE4033D6BEC2D 
Run Code Online (Sandbox Code Playgroud)

这很好.但是,当我通过终端从我的应用程序的根目录执行"ant list"时,它会出现此错误,

Buildfile: /Users/saad/Development/springapp/build.xml

list:

BUILD FAILED
/Users/saad/Development/springapp/build.xml:144: java.io.FileNotFoundException:     http://localhost:8080/manager/list
at     sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1624)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:230)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:150)
at org.apache.catalina.ant.ListTask.execute(ListTask.java:51)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
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:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at …
Run Code Online (Sandbox Code Playgroud)

ant list tomcat7

10
推荐指数
1
解决办法
5035
查看次数

spring batch ItemReader FlatFileItemReader 设置光标以从特定行开始读取或动态设置行跳过

在我的 springbatch+quartz 设置中,我正在使用 FlatFileItemReader 读取 CSV 文件。我想为阅读器设置光标,以使用给定的阅读器参数启动下一个作业实例。是否可以?

<bean id="cvsFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step">
    <!-- Read a csv file -->
    <property name="resource" value="classpath:cvs/input/report.csv" />

    <property name="lineMapper">
        <bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
            <property name="lineTokenizer">
                <bean
                    class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
                    <property name="names" value="id,impressions" />
                </bean>
            </property>
            <property name="fieldSetMapper">
                <bean
                    class="org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper">
                    <property name="prototypeBeanName" value="report" />
                </bean>
            </property>
        </bean>
    </property>

</bean>
Run Code Online (Sandbox Code Playgroud)

这个想法是在下一次执行中继续读取上次失败发生的文件。我为 customWriter 中写入的每一行放置一个整数“writecursor”。

public void write(List<? extends Report> items) throws Exception {

System.out.println("writer..." + items.size() + " > ");     
for(Report item : items){
    System.out.println("writing item id: " + item.getId());     
    System.out.println(item);

}
//getting …
Run Code Online (Sandbox Code Playgroud)

spring skip filereader spring-batch

4
推荐指数
1
解决办法
7495
查看次数

标签 统计

ant ×1

filereader ×1

list ×1

postgresql ×1

skip ×1

spring ×1

spring-batch ×1

tomcat7 ×1

user-roles ×1